Hello,
I wrote a macro that imports data from a text file, and uses data imputed in that text file in various other parts of the spreadsheet. Conveniently, the import macro is working fine for everyone in the office except for my boss's computer. When he runs the macro pasted below he gets a "run time error '1004' Excel cannot find the text file" and the debugger highlights ".Refresh BackgroundQuery:=FALSE"
My system does not encounter this issue. We are both using XP SP3 and office 2003 SP3.
Here is the macro:
Sheets("Imported_ORC").Select
Range("A1").Select
With ActiveSheet.QueryTables.Add(Connection:="TEXT;H:\home\OE\jobs\" & Range("JobNumber") & ".orc" _
, Destination:=Range("A1"))
.Name = "12-B-" & Range("A1")
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlReplaceDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = 437
.TextFileStartRow = 1
.TextFileParseType = xlFixedWidth
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1, 1)
.TextFileFixedColumnWidths = Array(33)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
Any suggestions would be extremely appreciated.
Thanks,
Tyler
I wrote a macro that imports data from a text file, and uses data imputed in that text file in various other parts of the spreadsheet. Conveniently, the import macro is working fine for everyone in the office except for my boss's computer. When he runs the macro pasted below he gets a "run time error '1004' Excel cannot find the text file" and the debugger highlights ".Refresh BackgroundQuery:=FALSE"
My system does not encounter this issue. We are both using XP SP3 and office 2003 SP3.
Here is the macro:
Sheets("Imported_ORC").Select
Range("A1").Select
With ActiveSheet.QueryTables.Add(Connection:="TEXT;H:\home\OE\jobs\" & Range("JobNumber") & ".orc" _
, Destination:=Range("A1"))
.Name = "12-B-" & Range("A1")
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlReplaceDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = 437
.TextFileStartRow = 1
.TextFileParseType = xlFixedWidth
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1, 1)
.TextFileFixedColumnWidths = Array(33)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
Any suggestions would be extremely appreciated.
Thanks,
Tyler