Export query results to Excel

P

Peter

How can I export the results of a query into an excel spreadsheet
without changing or existing data in the spreadsheet. Basically the
query is only 5 columns by 60 rows and the rest of the spreadsheet is
already ocuupied with data.
 
A

A C

Peter said:
How can I export the results of a query into an excel spreadsheet
without changing or existing data in the spreadsheet. Basically the
query is only 5 columns by 60 rows and the rest of the spreadsheet is
already ocuupied with data.

Invoke the TransferSpreadsheet command in a macro.

Steps:
-make a new macro.
-in the Action column, select TransferSpreadsheet
-once you have selected this action you will see a series of parameter
fields below asking for details.
- Set the transfer type to Export
- Set the spreadsheet type to the Excel version you have
- Set the Table name to the name of your query
- Enter a file name. Access stinks when it comes to entering paths with
spaces in here, so either dont do it or post back to learn how to do it.
- Has field names, up to you, but see below for more on this
- Range, leave blank. Dont leave blank = error.
-save and close.

When you run this macro it will export your data to the top left of a (new)
worksheet in your spreadsheet named <name_of_your_query>. If you didnt
already have a worksheet with this name it makes a new one, and if you did
it replaces the existing data.

Regards
A
 

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

Similar Threads

Export Records Into Existing Excel File 1
Automating export to Excel 4
Export to Excel 3
export to excel and save 4
Macro - Access 8
Export query to Excel fails 6
Create Excel Lab test results 1
Exporting to Excel 1

Top