Solved

MS Access export to Excel template

Posted on 2013-05-31
6
621 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
[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
  • 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
MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

 
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
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 Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

734 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