+ Reply to Thread
Results 1 to 17 of 17

Run saved exports

  1. #1
    Forum Contributor
    Join Date
    04-18-2013
    Location
    utah
    MS-Off Ver
    2010
    Posts
    668

    Run saved exports

    Is there a VBA to run all my saved exports when database is opened.

  2. #2
    Forum Expert boopathiraja's Avatar
    Join Date
    07-12-2013
    Location
    Coimbatore,TamilNadu, India
    MS-Off Ver
    Excel 2007, 2013, 2016, 365
    Posts
    1,455

    Re: Run saved exports

    Probably a pivot will help posting a sample will help
    Click just below left if it helps, Boo?ath?

  3. #3
    Forum Expert boopathiraja's Avatar
    Join Date
    07-12-2013
    Location
    Coimbatore,TamilNadu, India
    MS-Off Ver
    Excel 2007, 2013, 2016, 365
    Posts
    1,455

    Re: Run saved exports

    Sorry posted in wrong thread

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,887

    Re: Run saved exports

    It will have to be written specifically for your database. There is no generic code to do this.

    You would put the code in the OnOpen Event for a particular Form (probably the one that opens automatically) using the DoCmd.TransferSpreadsheet function for each query to export, listing them one after the other in your code.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  5. #5
    Forum Contributor
    Join Date
    04-18-2013
    Location
    utah
    MS-Off Ver
    2010
    Posts
    668

    Re: Run saved exports

    I am new to this can you send me a sample to work from.

  6. #6
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,887

    Re: Run saved exports

    See the attached.
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    04-18-2013
    Location
    utah
    MS-Off Ver
    2010
    Posts
    668

    Re: Run saved exports

    So i used your code and can't get it to work. I think part of the issue is i am trying to export tables not queries.

  8. #8
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,887

    Re: Run saved exports

    Should not make a difference, change up the document to be exported to the table name. Look at the code for this file. I changed the document to be exported to be the tables and not the queries.
    Attached Files Attached Files

  9. #9
    Forum Contributor
    Join Date
    04-18-2013
    Location
    utah
    MS-Off Ver
    2010
    Posts
    668

    Re: Run saved exports

    do i need to change the name and owner for this to run on my data base?

  10. #10
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,887

    Re: Run saved exports

    If you are running Win 7 or Win 8, you should not have to change the owner. This has been set to the name of the user on the machine you are using. I prefer to do it this way rather than hard code the user. If you want to understand this a little better, then look at this link on the Environ function.

    http://www.myengineeringworld.net/20...variables.html
    Last edited by alansidman; 11-13-2014 at 07:50 PM.

  11. #11
    Forum Contributor
    Join Date
    04-18-2013
    Location
    utah
    MS-Off Ver
    2010
    Posts
    668

    Re: Run saved exports

    Here is my code coverted for me and I can't get it to work.

    HTML Code: 

  12. #12
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,887

    Re: Run saved exports

    I can see nothing wrong with your code. Are you getting an error message? The files are not in the directory specified by the path?

    BTW: Since you are not exporting to the desktop, you do not need to define the owner nor set the variable. It is extraneous and can either be commented out or deleted.

    Also the message is telling you to look on your desktop but you are directing the tables to a directory in the U drive.

  13. #13
    Forum Contributor
    Join Date
    04-18-2013
    Location
    utah
    MS-Off Ver
    2010
    Posts
    668

    Re: Run saved exports

    They are not there. and when the compile check i got no errors.

  14. #14
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,887

    Re: Run saved exports

    At this point without actually viewing your db, I don't know what to tell you. When you opened my db, did the two tables appear on your desktop?

  15. #15
    Forum Contributor
    Join Date
    04-18-2013
    Location
    utah
    MS-Off Ver
    2010
    Posts
    668

    Re: Run saved exports

    yes sir. I will try and make it small enough to attach.

  16. #16
    Forum Contributor
    Join Date
    04-18-2013
    Location
    utah
    MS-Off Ver
    2010
    Posts
    668

    Re: Run saved exports

    sadly the system won't allow me to attach a database.

  17. #17
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,887

    Re: Run saved exports

    You will need to zip the file. You cannot upload a Access file directly. It must be in a zip file.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Queue database exports
    By {=OR(value=array)} in forum Access Tables & Databases
    Replies: 1
    Last Post: 04-04-2014, 01:37 PM
  2. Help with vlookup QuickBooks exports
    By novicejack in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-21-2009, 09:44 PM
  3. " in tab delimited file exports
    By PhilSM in forum Excel General
    Replies: 1
    Last Post: 01-26-2009, 07:00 AM
  4. Linking Excel and Word, Automatic Exports
    By XLink in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-22-2008, 04:59 PM
  5. [SOLVED] Quickbooks exports to Excel, cleaning up the mess afterwards
    By Mick Warren, TechniCater in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-25-2006, 02:15 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1