When importing a txt file into excel, I need to specify data types for the columns.

I'm currently using Excel 2003 (upgrade to 2010 is for later in the summer).

I have been able to find enumerations of the possible values for xlColumnDataType for version 2007 and 2010 of Excel VBA, but not for Excel 2003.

Are the possible values the same in Excel 2003 as in the later versions?

The usage of xlColumnData type is as such when importing a 3 column txt file.

    Workbooks.OpenText FileName:= "the file name to be imported.txt", _
<various other arguments>,_

FieldInfo:=Array(Array(1, 2), Array(2, 2), Array(3, 1)),

I need to know the possible values of the second numeric value in each Array argument and what data types they correspond to.

UPDATE: For reference sake here is the list of xlColumnDataType sorted by the value number:

xlGeneralFormat 1 xlTextFormat 2 xlMDYFormat 3 xlDMYFormat 4 xlMDFFormat 5 xlMYDFormat 6 xlDYMFormat 7 xlYDMFormat 8 xlSkipColumn 9 xlEMDFormat 10


I don't if they are the same across versions, but I'll be they are. If anything, the values in 2003 will work in 2007. There maybe something that doesn't work backward, but I doubt it.

In the VBE, View - Object Browser (F2). Search for xlColumn and look for xlColumnType in the Class column of the results. That will list all the enumerations in the lower pane. You can click on any of those to see the numerical equivalent below that pane. They're not in order, so you have to keep going down the list until you get the number you want.

  • Thanks. I updated the question to include the list sorted by value number. – music2myear Apr 18 '11 at 20:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.