Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
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
Medium Priority
?
1,372 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 39

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 31

Accepted Solution

by:
hnasr earned 1500 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

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

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

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
This article describes a serious pitfall that can happen when deleting shapes using VBA.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

636 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