Results 1 to 4 of 4
  1. #1
    nagiese is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jan 2011
    Location
    Nashville, TN
    Posts
    43

    Question VBA Code to save an Excel file using a Form


    I'm trying to automate a reporting process and I've currently got an Excel file that gets populated via data in a Access database then the master Excel file is saved. Now the users want the database to also save a copy of this Excel file to a monthly folder. So the file path would have to be changed each month. How do I write VB code that will save a copy of the Excel file in a specific location which is auto populated in a form text box?

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    I can't resist. The answer to "How do I write VB code that will..." is, you just type it into the VBA editor.

    Now, if you want to know what code to use, my first thought is FileCopy. You can use the textbox for the destination argument.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    nagiese is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jan 2011
    Location
    Nashville, TN
    Posts
    43
    Touche` lol
    Thanks for the tip. I'll give it a try.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    No problem, post back if you get stuck.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Report to save as Excel file
    By ashu.doc in forum Reports
    Replies: 7
    Last Post: 07-20-2015, 10:18 AM
  2. excel compatibility checker, file save issue
    By trevor40 in forum Programming
    Replies: 2
    Last Post: 12-04-2014, 07:59 PM
  3. Save As dialog box exporting Excel file
    By accessnewbie in forum Access
    Replies: 1
    Last Post: 03-09-2013, 03:15 PM
  4. Open,new and save as an excel target file
    By dacodac in forum Programming
    Replies: 7
    Last Post: 01-31-2013, 05:25 AM
  5. How do you file save an 'Attachment' content through code?
    By morespamforya in forum Programming
    Replies: 3
    Last Post: 08-06-2010, 08:58 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums