Solved

MS Access export to Excel template

Posted on 2013-05-31
6
598 Views
Last Modified: 2013-05-31
Hi,

I would be very grateful if someone could help me with the following.

I have an Excel workbook with several worksheets and VBA.  I would like to export data from various tables in an Access database to the Excel workbook.  

Is there an equivalent of the Workbook.SaveAs method in Excel that I can use in Access?  Effectively, I would like to open the Excel workbook as a template and save the updated version with a different filename?

Many thanks in advance
Alison
0
Comment
Question by:alisonthom
  • 3
  • 2
6 Comments
 
LVL 47

Accepted Solution

by:
Dale Fye (Access MVP) earned 250 total points
ID: 39211631
In Access, the item you should look at to start is the transfer spreadsheet method.  This will allow you to export a table or query to a workbook.

You would start out by copying your template file  and saving it with a new name.  Then use transfer spreadsheet to export your data to the new workbook.  I'm working from my iPad or I would provide a code example.

You can also search EE on "transferdatasheet" to get some examples.
0
 
LVL 16

Expert Comment

by:Calvin Brine
ID: 39211646
Are you executing the VBA from your Excel workbook?  So, you want to import data from the your access database to your excel worksheet?  I would suggest you setup an ADO connection to your database, and use SQL to extract your data to excel.  Once you have an ADO recordset in your excel code, you can place the results of your SQL query where ever you want in excel.  Without have details of your access table names, database location, which sheet and cell you want to place the access data in etc... , it would be difficult to give you code.

HTH
Cal
0
 

Author Comment

by:alisonthom
ID: 39211679
With respect to the response from Chrine, the VBA code to export data from Access to Excel is within Access.  Can I achieve my objective using VBA in Access?

Thanks
Alison
0
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
ID: 39211695
Alison, yes, you can, see my comment and Search the Access zone for the TransferSpreadsheet method.
0
 

Author Closing Comment

by:alisonthom
ID: 39211993
It is now working as I hoped.
fyed - Thanks so much for your help
Alison
0
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
ID: 39212002
Glad I could help.
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
IIF help, YN field 7 22
Select/Copy row and pasting it lower in sheet 7 19
Excel Formula 16 43
Problem copying record details to a new record 5 8
Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
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…
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

776 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