Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Cornwall, England
    Posts
    393
    Thanks
    0
    Thanked 0 Times in 0 Posts

    running Excel from Access (Access 97/ Excel 97)

    Hi,
    I need to open a .csv file in excel and then save it as .xls so that it will import properly. (Dont ask, but for some reason IP address nnn.nnn.nnn.nnn do not import in a DoCmd.TransferText action but a DoCmd.TransferSpreadsheet does - go figure !)

    I have got as far as :
    dim objXL as applixcation
    set objXL = new Excel.Application

    ...but am now stuck, in so far as how do i get the XL application to open a csv file - i have the full path of the file already in the access application.

    Any suggestions/pointers received with thanks !

  2. #2
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: running Excel from Access (Access 97/ Excel 97)

    Hi,
    You should be able to do it with something like this:
    Set wbkExcel = myXL.Workbooks.Open("C:Book1.csv")
    wbkExcel.SaveAs "C:Book1.xls", xlWorkbookNormal
    Hope that helps.
    Regards,
    Rory

    Microsoft MVP - Excel

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Cornwall, England
    Posts
    393
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: running Excel from Access (Access 97/ Excel 97)

    spot on, thank you

Posting Permissions

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