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,230 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 34

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 119

Expert Comment

by:Rey Obrero
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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

We were having a lot of "Heartbeat Alerts" in our SCOM environment, now "Heartbeat" in a SCOM environment for those of you who might not be familiar with SCOM is a packet of data sent from the agent to the management server on a regular basis, basic…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

744 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now