Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Sue Sue is offline
external usenet poster
 
Posts: 285
Default Error Message regarding .TextFilePlatform = 437

I've written a macro with a getDirectory(StrPath) so that the user can choose
where to get the txt file to import from. The problem is that it works fine
on my PC as well as a laptop but for some reason don't work on a workstation
where I tried to implement the code.

With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;" & StrPath, Destination _
:=Range("A1"))
.Name = "SeeName"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = 437
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = False
.TextFileSemicolonDelimiter = True
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1, 1, 1, 9, 1, 1, 1,
1, 9)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With

Can someone please help me to correct this so that I can implement the
application on any machine.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Error Message regarding .TextFilePlatform = 437

is the version of excel on the machine where it fails an older version than
the others.
If so, then record youself manually setting up the querytable in that older
version. Compare the recorded code to the code you have. Remove items that
are not found in both versions.

--
Regards,
Tom Ogilvy


"Sue" wrote:

I've written a macro with a getDirectory(StrPath) so that the user can choose
where to get the txt file to import from. The problem is that it works fine
on my PC as well as a laptop but for some reason don't work on a workstation
where I tried to implement the code.

With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;" & StrPath, Destination _
:=Range("A1"))
.Name = "SeeName"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = 437
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = False
.TextFileSemicolonDelimiter = True
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1, 1, 1, 9, 1, 1, 1,
1, 9)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With

Can someone please help me to correct this so that I can implement the
application on any machine.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Error Message regarding .TextFilePlatform = 437

Sue,
According to XL2002 Help, which to me is somewhat misleading:
"TextFilePlatform Property
Returns or sets the origin of the text file you're importing into the query
table. This property determines which code page is used during the data
import. The default value is the current setting of the File Origin option
in the Text File Import Wizard. Read/write XlPlatform.
XlPlatform can be one of these XlPlatform constants.
xlMacintosh
xlMSDOS
xlWindows "

And the Object Browser shows values of XlPlatform to be:
Const xlMacintosh = 1
Const xlWindows = 2
Const xlMSDOS = 3

However, this is really the code page to use for the import, where 437
refers to "OEM United States".

So not sure what the problem is, but Tom's reply probably applies.

NickHK

"Sue" wrote in message
...
I've written a macro with a getDirectory(StrPath) so that the user can

choose
where to get the txt file to import from. The problem is that it works

fine
on my PC as well as a laptop but for some reason don't work on a

workstation
where I tried to implement the code.

With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;" & StrPath, Destination _
:=Range("A1"))
.Name = "SeeName"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = 437
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = False
.TextFileSemicolonDelimiter = True
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1, 1, 1, 9, 1, 1,

1,
1, 9)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With

Can someone please help me to correct this so that I can implement the
application on any machine.



  #4   Report Post  
Posted to microsoft.public.excel.programming
Sue Sue is offline
external usenet poster
 
Posts: 285
Default Error Message regarding .TextFilePlatform = 437

Thanks, will try.

"Tom Ogilvy" wrote:

is the version of excel on the machine where it fails an older version than
the others.
If so, then record youself manually setting up the querytable in that older
version. Compare the recorded code to the code you have. Remove items that
are not found in both versions.

--
Regards,
Tom Ogilvy


"Sue" wrote:

I've written a macro with a getDirectory(StrPath) so that the user can choose
where to get the txt file to import from. The problem is that it works fine
on my PC as well as a laptop but for some reason don't work on a workstation
where I tried to implement the code.

With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;" & StrPath, Destination _
:=Range("A1"))
.Name = "SeeName"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = 437
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = False
.TextFileSemicolonDelimiter = True
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1, 1, 1, 9, 1, 1, 1,
1, 9)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With

Can someone please help me to correct this so that I can implement the
application on any machine.

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
replace VBA run-time error message with custom message BEEJAY Excel Programming 13 July 14th 06 03:59 PM
error message: compile error, argument not optional Pierre via OfficeKB.com Excel Programming 3 September 5th 05 03:45 PM
changing the message in an error message The Villages DA Excel Worksheet Functions 2 February 18th 05 05:30 PM
How do I get rid of "Compile error in hidden module" error message David Excel Discussion (Misc queries) 4 January 21st 05 11:39 PM
Problem with textfileplatform halarikeyur[_4_] Excel Programming 0 November 4th 04 06:58 PM


All times are GMT +1. The time now is 03:38 PM.

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"