Re: change folder
From: John Garate (j.garate_at_comcast.net)
Date: 03/23/05
- Next message: Jac Tremblay: "Re: Memory problem or Excel limitation - For *** Kusleika"
- Previous message: Peter T: "Re: Batch Replace function for Large strings"
- In reply to: TroyW: "Re: change folder"
- Next in thread: TroyW: "Re: change folder"
- Reply: TroyW: "Re: change folder"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 23 Mar 2005 12:55:04 -0500
Troy,
I'ts when I change the line of code to "TEXT;C:\EMP4\Tab files for Excel\EM
Church Schedule.tab",
that the macro hangs. The only thing Ive done is change EMP3 to EMP4.
I know I could repeat using the MacroRecorder, but this is a diddicult
process because of the query. I was hoping to just to edit the code.
John
"TroyW" <nospam@yahoo.com> wrote in message
news:eDgT4KzLFHA.3812@TK2MSFTNGP10.phx.gbl...
> John,
>
> Disregard the previous information that I gave. It looks like you used the
> MacroRecorder to record importing a file using the "Data | Import External
> Data | Import Data..." command from the menubar.
>
> You will need to modify the following line of code in
> "ImportChurchSchedule":
>
> From: "TEXT;C:\EMP3\Tab files for Excel\EM Church Schedule.tab",
>
> To: "TEXT;C:\EMP4\Tab files for Excel\EM Church Schedule.tab",
>
> Or you could repeat using the MacroRecorder to record importing the file
> from it's new location
>
> Troy
>
> "John Garate" <j.garate@comcast.net> wrote in message
> news:ediKVNxLFHA.2420@TK2MSFTNGP12.phx.gbl...
>> Troy,
>> I'm not sure what you are telling me. I really just starting to learn to
>> use
>> visual basic. I don't see the querytables commands you refer to. I've
>> pasted
>> a copy of the macro into this email.
>>
>>
>>
>> Sub ImportChurchSchedule()
>> '
>> ' ImportVisitSchedule Macro
>> ' Macro recorded 2/11/2005 by Jag
>> '
>>
>> '
>> Range("B3").Select
>> With Active***.QueryTables.Add(Connection:= _
>> "TEXT;C:\EMP3\Tab files for Excel\EM Church Schedule.tab",
>> Destination:=Range( _
>> "B3"))
>> .Name = "EM Visit Schedule"
>> .FieldNames = True
>> .RowNumbers = False
>> .FillAdjacentFormulas = False
>> .PreserveFormatting = True
>> .RefreshOnFileOpen = False
>> .RefreshStyle = xlInsertDeleteCells
>> .SavePassword = False
>> .SaveData = True
>> .AdjustColumnWidth = True
>> .RefreshPeriod = 0
>> .TextFilePromptOnRefresh = False
>> .TextFilePlatform = xlWindows
>> .TextFileStartRow = 1
>> .TextFileParseType = xlDelimited
>> .TextFileTextQualifier = xlTextQualifierNone
>> .TextFileConsecutiveDelimiter = False
>> .TextFileTabDelimiter = True
>> .TextFileSemicolonDelimiter = False
>> .TextFileCommaDelimiter = False
>> .TextFileSpaceDelimiter = False
>> .TextFileColumnDataTypes = Array(1, 1, 1, 1)
>> .Refresh BackgroundQuery:=False
>> End With
>> End Sub
>> Sub FormateDateColumn()
>> '
>> ' FormateDateColumn Macro
>> ' Macro recorded 2/11/2005 by Jag
>> '
>>
>> '
>> Columns("B:B").Select
>> Selection.NumberFormat = "mm-dd"
>> With Selection
>> .HorizontalAlignment = xlLeft
>> .VerticalAlignment = xlBottom
>> .WrapText = False
>> .Orientation = 0
>> .AddIndent = False
>> .IndentLevel = 0
>> .ShrinkToFit = False
>> .MergeCells = False
>> End With
>> Selection.NumberFormat = "mmm-dd"
>> Range("F14").Select
>> End Sub
>> Sub InsertData()
>> '
>> ' InsertData Macro
>> ' Macro recorded 2/11/2005 by Jag
>> '
>>
>> '
>> Application.Run "ImportVisitSchedule"
>> Application.Run "SetColumnWidths"
>> Application.Run "FormateDateColumn"
>> End Sub
>>
>> Public Sub Auto_Open()
>> Application.WindowState = xlMaximized
>> End Sub
>
>
- Next message: Jac Tremblay: "Re: Memory problem or Excel limitation - For *** Kusleika"
- Previous message: Peter T: "Re: Batch Replace function for Large strings"
- In reply to: TroyW: "Re: change folder"
- Next in thread: TroyW: "Re: change folder"
- Reply: TroyW: "Re: change folder"
- Messages sorted by: [ date ] [ thread ]