ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel 2000 Import Error (https://www.excelbanter.com/excel-programming/346234-excel-2000-import-error.html)

ken4capitola

Excel 2000 Import Error
 
I written an Excel application that works fine on Excel2002 but error
breaks on .TextFilePlatform=437 when a user runs it on Excel2000. For
all the marbles, what is 437? and can I safely comment out the
statement? Is this a known compatiblitiy problem ?

Thanks in advance.


With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;" & ScratchFile _
, Destination:=Range("A1"))
.Name = T6Infile
.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 = True
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1)
.TextFileTrailingMinusNumbers = True
.TextFileSemicolonDelimiter = True
.TextFileCommaDelimiter = False
.Refresh BackgroundQuery:=False

End With


Mike Fogleman

Excel 2000 Import Error
 
I don't know what platform 437 is and obviously Excel doesn't either. You
could check the text import wizard's File Origin setting. From VBHelp:

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. Can be one of the following XlPlatform constants: xlMacintosh,
xlMSDOS, or xlWindows. The default value is the current setting of the File
Origin option in the Text File Import Wizard. Read/write XlPlatform.

Remarks

Use this property only when your query table is based on data from a text
file (with the QueryType property set to xlTextImport).



Mike F

"ken4capitola" wrote in message
ups.com...
I written an Excel application that works fine on Excel2002 but error
breaks on .TextFilePlatform=437 when a user runs it on Excel2000. For
all the marbles, what is 437? and can I safely comment out the
statement? Is this a known compatiblitiy problem ?

Thanks in advance.


With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;" & ScratchFile _
, Destination:=Range("A1"))
.Name = T6Infile
.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 = True
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1)
.TextFileTrailingMinusNumbers = True
.TextFileSemicolonDelimiter = True
.TextFileCommaDelimiter = False
.Refresh BackgroundQuery:=False

End With




ken4capitola

Excel 2000 Import Error
 
I commented it out along with (.TextFileTrailingMinusNumbers = True )
and it ran on the Excel 2000.

Faced with seeing all this extraneous code generated from a recorded
macro, is there a clever way to knowing what's important. My technique
has been to keep stripping unit it doesn't work, but there's got to be
a better way.



All times are GMT +1. The time now is 07:43 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com