Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exporting from Access to an Excel Template

Status
Not open for further replies.

instructorgirl

Instructor
Mar 14, 2005
40
US
I would like to export an Access query to an Excel template that contains macros. I am very new to coding in VBA. Do I need to create the code in Access and assign it to a button on a form? That's what I would like to do. I have tried several different methods using some of the macro actions in access to transfer the data to excel, but I haven't figured out how to open the template as an .xls file. Any suggestions for coding this would be greatly appreciated. I'm all out of ideas!
 
Why not pulling the info from excel with a QueryTable ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
I tried going into Data, Import External Data, New Database Query and I get an error message that says, "Two few parameters expected" and it will not connect. So I went into HELP to see what that error message meant and it told me that I have an incorrect driver. I don't know what that means and what I have to do to fix it. Any suggestions?
 
This error is usally caused by a the query in Access that you are using for the data has a user critera stated.

Example: I have a query in access that will pull the data using a date range that I am prompted for every time I run the query.

If I try to use MS Query from Excel to pull the data from this I will get the error "Two few parameters expected". If I change the Access query to not prompt for the dates, The MS Query from Excel will now work.

I hope I explained this properly.

Dave
 
Thanks for your help. I'm dumping the data into a temp table and I'm using the table instead of the query with the parameters. It works just fine. Thanks alot!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top