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,244 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

User Beware!  This is a rather permanent solution to removing your email from an exchange server.  The only way to truly go back is to have your exchange administrator restore your mailbox from backups.  This is usually the option of last resort.  A…
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.

910 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

19 Experts available now in Live!

Get 1:1 Help Now