Results 1 to 4 of 4

Exporting a module into an Excel file

  1. #1
    Sephaerius is offline Advanced Beginner
    Windows 7 64bit Access 2016
    Join Date
    Aug 2013
    Posts
    60

    Exporting a module into an Excel file

    This might sound odd, but I'm trying to figure out possible solutions to a problem. My idea in this case would be to use Access to create an Excel file (simple enough) but not only would I want it to write the table data into the file, but I would also like it to copy/export a selection of VBA into the workbook, so that when that file is opened, a workbook open event could execute. The latter is the part I need help with. I've got everything setup and the finished file being created. Now, if there's a way to "send" a module into the created Excel file - that might solve my issue. Thoughts?


    Thanks,

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    7,537
    in Access VBE, you can export the module, : right click , export, save it
    then in excel VBE: file, import, that same file

  3. #3
    Sephaerius is offline Advanced Beginner
    Windows 7 64bit Access 2016
    Join Date
    Aug 2013
    Posts
    60
    Quote Originally Posted by ranman256 View Post
    in Access VBE, you can export the module, : right click , export, save it
    then in excel VBE: file, import, that same file
    I was aiming for a completely automated solution, so that the finished Excel file contains everything it needs. My interim solution is to house a "template" file elsewhere which the database copies in and renames, then Access exports the tables to that saved template file, rather than Access creating a new file. The template contains the Workbook_Open code that needs to run, so now when my end users open their report, it'll execute and give them what they need. I hope.

  4. #4
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    7,537
    theres no need to automate. All the code should already be there and shouldn't update so often that you need automation.

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

Similar Threads

  1. Exporting a Access Report to an Excel File
    By Coffee in forum Import/Export Data
    Replies: 2
    Last Post: 07-28-2014, 10:32 AM
  2. Exporting a query to Excel File
    By crowegreg in forum Import/Export Data
    Replies: 2
    Last Post: 08-08-2013, 04:25 PM
  3. Save As dialog box exporting Excel file
    By accessnewbie in forum Access
    Replies: 1
    Last Post: 03-09-2013, 02:15 PM
  4. Need help exporting large Access file into Excel
    By phidelt in forum Import/Export Data
    Replies: 2
    Last Post: 02-27-2013, 05:14 PM
  5. Exporting to formatted Excel file
    By Xerin in forum Access
    Replies: 4
    Last Post: 10-21-2011, 02:33 PM

Posting Permissions

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