Results 1 to 2 of 2

Thread: Date format in Excel file

  1. #1

    Thread Starter
    Addicted Member Screamager's Avatar
    Join Date
    May 2001
    Location
    Dublin, Ireland
    Posts
    174

    Date format in Excel file

    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:
    1. oExcel.Workbooks.OpenText FileName:=CSVFileName, DataType:=xlDelimited, textqualifier:=xlTextQualifierNone, _
    2.                     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.
    Computer /nm./: a device designed to speed and automate errors

  2. #2

    Thread Starter
    Addicted Member Screamager's Avatar
    Join Date
    May 2001
    Location
    Dublin, Ireland
    Posts
    174

    Re: Date format in Excel file

    Excel version is 2000 on NT4. And yes... I have checked my regional settings
    Computer /nm./: a device designed to speed and automate errors

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width