Solved

MS Access export to Excel template

Posted on 2013-05-31
6
577 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
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
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…

708 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

18 Experts available now in Live!

Get 1:1 Help Now