ChuckDrago
Active Member
- Joined
- Sep 7, 2007
- Messages
- 470
- Office Version
- 2010
- Platform
- Windows
Hi everyone,
I created a macro that parses a text file into Excel in order to manipulate the data into various modalities. The text file (fname.txt) must be placed in a specific folder ("C:\PeakTorque") to be read. Everything went well, as intended...until I sent the macro to our client out of state. He gets an MS message indicating inability to find the file. The way I used to create the parsing routine was to record it. The resulting code is:
Can anyone provide a hint as to what might be wrong?
As usual, thanks in advance
Chuck
I created a macro that parses a text file into Excel in order to manipulate the data into various modalities. The text file (fname.txt) must be placed in a specific folder ("C:\PeakTorque") to be read. Everything went well, as intended...until I sent the macro to our client out of state. He gets an MS message indicating inability to find the file. The way I used to create the parsing routine was to record it. The resulting code is:
Code:
Dim ShfName As String
ShfName = Left(fName, Len(fName) - 4)
With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;C:\PeakTorque\" & fName, Destination:= _
Range("$B$15"))
.Name = ShfName
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = 65001
.TextFileStartRow = 52
.TextFileParseType = xlFixedWidth
.TextFileTextQualifier = xlTextQualifierNone
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = False
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1, 1, 1)
.TextFileFixedColumnWidths = Array(6, 7, 11, 10, 11, 12, 14)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
Can anyone provide a hint as to what might be wrong?
As usual, thanks in advance
Chuck