Hi,
I'm creating an Excel file in VB by opening a CSV file and moving some columns and stuff around... you know, to pretty things up. My problem is this. If I open the CSV file in excel manually I get the wizard to help me convert the file to the proper format. I select comma as the delimiter, leave all columns in general data format. This works fine.
If I do what should (in theory) be the same operation in my VB code the dates come out as american dates in the one column that has dates in it. Dates that can't be interpreted as american dates (like 29/05/06... 29 being the month) are not imported as dates at all.
This is how I open the CSV file:
VB Code:
oExcel.Workbooks.OpenText FileName:=CSVFileName, DataType:=xlDelimited, textqualifier:=xlTextQualifierNone, _ COMMA:=True, fieldinfo:=Array(4, xlTextFormat)
This should (as I understand it anyway) open the csv file, interpret it as a delimited file with comma as the delimiter, expect no quotes for text and import the D (4th) column as straight text. It still does the same thing with the dates though.




Reply With Quote