Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

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.

share|improve this answer
    
Thanks. I updated the question to include the list sorted by value number. –  music2myear Apr 18 '11 at 20:56
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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