1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: Saving a file in Access vba

Discussion in 'Software Development' started by Condor76, Jan 24, 2006.

Thread Status:
Not open for further replies.
Advertisement
  1. Condor76

    Condor76 Thread Starter

    Joined:
    Nov 11, 2005
    Messages:
    17
    I'm opening an xls spreadsheet from a table in my access app using: "DoCmd.OutputTo acOutputTable,"

    Is there a way to save this file to my PC? I'm having a hard time figuring out how to do this thru VBA.

    Thank you! :confused:
     
  2. OBP

    OBP Temporarily Banned

    Joined:
    Mar 8, 2005
    Messages:
    19,889
    Doesn't it create and save it automatically?
    Or save it when you close it?
     
  3. OBP

    OBP Temporarily Banned

    Joined:
    Mar 8, 2005
    Messages:
    19,889
    Why are you outputting the table rather than "live linking" to a Query based on the table?
     
  4. OBP

    OBP Temporarily Banned

    Joined:
    Mar 8, 2005
    Messages:
    19,889
    I have just used this

    DoCmd.OutputTo acOutputTable, "times", acFormatXLS, "times.xls", True

    and the "True" on the end opened the Excel sheet and it did not ask me to save it when I closed Excel, so it was already saved. I have checked and it is on my drive "C:" in my Access Folder
     
  5. cristobal03

    cristobal03

    Joined:
    Aug 5, 2005
    Messages:
    3,086
    I'd suggest using TransferSpreadsheet rather than OutputTo because it's specifically designed for Excel. The main issue with OutputTo is that you can't modify the file format of the created spreadsheet, which is built using Excel 3.0 or something crazy-old. TransferSpeadsheet, on the other hand, allows you to use a file format argument to make sure the exported file is in the latest format.

    It's all in the VBA help docs under TransferSpreadsheet Method and TransferSpreadsheet Action.

    HTH

    chris.
     
  6. Condor76

    Condor76 Thread Starter

    Joined:
    Nov 11, 2005
    Messages:
    17
    Thank you!!!!
     
  7. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/436930

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice