Results 1 to 5 of 5

Thread: Problem opening .csv files via EXCEL-VBA [used a workaround, forget it, thanks]

  1. #1

    Thread Starter
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863

    Problem opening .csv files via EXCEL-VBA [used a workaround, forget it, thanks]

    Hi,
    I can't figure out why it seems impossible to corectly open a .csv file (Comma delimted) using
    VB Code:
    1. Workbooks.Open FileName:=FileName, Format:=6, Delimiter:=","
    It will open with the firtst cell in each row filled like "bla1,bla2,bla3" instead of putting the 3 bla'S into three seperate cells.
    But if I open that file with a doubleclick manually it will open correctly??
    Last edited by opus; Jul 3rd, 2003 at 02:16 PM.
    You're welcome to rate this post!
    If your problem is solved, please use the Mark thread as resolved button


    Wait, I'm too old to hurry!

  2. #2
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    If it's only commas, won't this line work itself?
    VB Code:
    1. Workbooks.Open FileName

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  3. #3

    Thread Starter
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863
    no, always the same result????
    What'S the difference, if I open a file by double-clicking in the Explorer or using VBA?
    You're welcome to rate this post!
    If your problem is solved, please use the Mark thread as resolved button


    Wait, I'm too old to hurry!

  4. #4
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    Shouldn't really be any difference, some files Excel will open straight off & some it'll give you the csv / conversion / open wizard screen thing but I've never seen it open differently between the 2...

    Can't you record a macro in Excel, then open the file from the file menu & pinch whatever code it's used to do this?

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  5. #5

    Thread Starter
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863
    Maybe I'm stupid, but what menu commands are needed to make EXCEL open the .CSV file correct? Just the File/Open/Filename doesn't do it (the outcome is the same as discribed above).
    I even looked at the command that is done when doing the Explorer doubleclick (it's using DDE, and the command to start EXCEL is " "C:\Programme\Microsoft Office\Office\excel.exe" /e" ).
    I can'T see anything that would cause trouble.
    You're welcome to rate this post!
    If your problem is solved, please use the Mark thread as resolved button


    Wait, I'm too old to hurry!

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