export to specific excel worksheet

L

Levi

I need to export several different queries into one excel
file, and put each query on a separate worksheet. What is
the best way to do this?
 
R

Richard Choate

The solution you just got from John is the ADO method of copyfromrecordset.
I don't know, however, why you would want to delete worksheets and make new
ones. You can specify the destination within a specific Excel workbook for
each query you send. I do this all the time. If you are concerned about
overwriting existing data issues when you run your code again and again,
just add some code to clear out the existing data before sending the
recordset to Excel. There is considerable help available for this, and if
this is what you want, I can help you with some specific code.

I will advise, though, that if you must do a lot of massaging of the data
after it reaches Excel, you would be wise to run the code from Excel and "go
get" the data from Access, instead of sending the data to Excel. The code is
very similar with each method.

Richard Choate

I need to export several different queries into one excel
file, and put each query on a separate worksheet. What is
the best way to do this?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top