• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 854
  • Last Modified:

MS Access export to Excel template

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
alisonthom
Asked:
alisonthom
  • 3
  • 2
1 Solution
 
Dale FyeCommented:
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
 
Calvin BrineCommented:
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
 
alisonthomAuthor Commented:
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
Dale FyeCommented:
Alison, yes, you can, see my comment and Search the Access zone for the TransferSpreadsheet method.
0
 
alisonthomAuthor Commented:
It is now working as I hoped.
fyed - Thanks so much for your help
Alison
0
 
Dale FyeCommented:
Glad I could help.
0

Featured Post

Industry Leaders: 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!

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now