Solved

Control Button to Export Access Tables to Excel Database with Multiple Sheets (overwrite data in Excel; do not create new sheets)

Posted on 2013-12-23
6
1,284 Views
Last Modified: 2013-12-27
NEW!  MS Access 2013:  I have a database with 6 tables.  It would be very useful to me if I could get a code that, upon the click of a Form’s Control Button, would automatically export each of these tables to an MS Excel Spreadsheet (each Table is placed into a separate, same name sheet).  

It is very important, though, that the exported data always goes to the same Spreadsheet with the same Sheets (they have already been created)—and simply over-writes any data that may already exist in the Excel Sheets.  This is because there is another Excel Spreadsheet that has formula’s attached to each sheet within this one).

Attached is my Excel Spreadsheet along with my Access Database.  The 6 tables I would like export are:

InputT1
InputT2
SentenceOptionT1
SentenceOptionT2
NotesT1
NotesT2

The Excel Spreadsheet (Path) is:  
C:\Users\Matt\Desktop\Access Table Dump.xlsx

Can anyone help with this one?
Final-WUCAINS.accdb
Access-Table-Dump.xlsx
0
Comment
Question by:mdstalla
6 Comments
 
LVL 36

Expert Comment

by:PatHartman
ID: 39737336
Use TransferSpreadsheet to export the data.  Reference the same file name for all 6 exports and use a query name that matches a sheet name to target a specific sheet.  So use a query named InputT1 to export the data you want to export to the sheet named InputT1.  Query InputT2 will export to sheet InputT2, etc.
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 39737337
test this, place both the db and the excel file in the same folder

click on the Button Export 2 XL
Final-WUCAINS-rev.accdb
0
 
LVL 35

Expert Comment

by:[ fanpages ]
ID: 39737715
0
 

Author Comment

by:mdstalla
ID: 39738042
I've requested that this question be deleted for the following reason:

Created a better defined queston.
0
 
LVL 30

Accepted Solution

by:
hnasr earned 500 total points
ID: 39738815
Try: using D:\xl.xlsx file

Steps
Export  table to workbook as Sheet TableTemp
Copy Sheet TableTemp
Paste to Sheet Table
Delete Sheet TableTemp.
Final-WUCAINS-2.accdb
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
Having trouble getting your hands on Dynamics 365 Field Service or Project Service trial? Worry No More!!!
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question