Excel 2000 Import Error

K

ken4capitola

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
 
M

Mike Fogleman

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
 
K

ken4capitola

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top