Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default macro problems

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



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default macro problems

John,

I don't use QueryTables, but looking it up in help, it suggests that the
TextFilePlatform property can have one of 3 values, xlMacintosh, xlMSDOS, or
xlWindows (1, 3 or 2), so I am not sure where you get 1252 from. Could I
suggest that you try it with a value of 2?

Alternatively, re-record the macro on the Win98 machine and see what
differences you get.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"John Garate" wrote in message
...
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





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro problems Father John Excel Discussion (Misc queries) 3 April 20th 10 11:24 PM
Problems with macro fieldsy73 Excel Discussion (Misc queries) 1 February 26th 07 03:04 AM
Macro problems Heine Excel Worksheet Functions 9 October 31st 06 11:01 AM
Macro problems Shorty Excel Programming 0 November 11th 04 04:24 PM
various macro problems legepe[_12_] Excel Programming 0 October 23rd 04 11:07 PM


All times are GMT +1. The time now is 03:06 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"