By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,603 Members | 1,013 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,603 IT Pros & Developers. It's quick & easy.

Exporting a table from Access to formatted Excel file

P: 2
Hello all,

I am new to VBA and I am not very good at it. I have chosen to learn VBA for this simple reason...I can't figure out how to export an Access table into a formatted excel document.

Is there a code that will allow this to happen?

Would it be easier to import from Excel and use a Macro?

Please help! I will send money! :)

I have Microsoft Office 2003
May 24 '07 #1
Share this Question
Share on Google+
3 Replies

ADezii
Expert 5K+
P: 8,750
Hello all,

I am new to VBA and I am not very good at it. I have chosen to learn VBA for this simple reason...I can't figure out how to export an Access table into a formatted excel document.

Is there a code that will allow this to happen?

Would it be easier to import from Excel and use a Macro?

Please help! I will send money! :)

I have Microsoft Office 2003
Try the following code which will Export an Access Table (tblEmployee) to a pre-formatted, existing Excel Worksheet named Employee.xls in the C:\ Directory. Let me know how you make out.
Expand|Select|Wrap|Line Numbers
  1. DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "tblEmployee", "C:\Employee.xls", True
May 24 '07 #2

P: 2
Thank you so much for your reply. That looks great! Do I make a module somewhere in Access to house that code? Im new to this and Im not sure where to put that code to make it work.

I put it in a module and Im not sure how to make it run.
May 24 '07 #3

NeoPa
Expert Mod 15k+
P: 31,770
You could put it behind a button on a form.
Let us know if you need help with this.
May 26 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.