I wrote a macro with Excel 2002 on Windows XP. It runs fine. It uses the
Insert External data command to import a tab-delimited file into a
pre-formatted excel workbook.
However, when I load the worksheet (with the macro) on a Win98 second
edition platform running Excel 2000, I get the following error message:
Error 5: Invalid procedure, call or argument.
This occurs at the line: TextFilePlatform = 1252
I'm not sure if this is an Excel 2000 issue or a platform issue.
The full macro is:
Import_roster Macro
' Macro recorded 6/3/2004 by John A. Garate
'
'
Sheets("Roster").Select
Range("B3").Select
With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;F:\Lectors\Tab files\roster.tab", Destination:=Range("B3"))
.Name = "roster"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = False
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = 1252
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierNone
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1, 1, 1, 1, 1)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
End Sub
--
John Garate