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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

send to Excel

Status
Not open for further replies.

nevstic

Instructor
Jul 30, 2002
98
GB
Greetings all
I am using the following code to send the results of a query to Excel

DoCmd.OutputTo acOutputQuery, "Import op by week", acFormatXLS, "C:\Test.xls", True

It sends it OK but makes a new spreadseet every time.
Can I alter the code to send the results of the query
to an existing spreadsheet, where the charts and things are already set up ? rather than create a new one all the time.

thanks and rgds
Nick
 
as far as I know you can only create a new file with the DoCmd.OutputTo command.

A solution is to have to spread sheet with all the charts in reference the one created by the DoCmd.OutputTo command.

Then when the spread sheet is opend it will always pick up the most recent data.

Alternatively you can directly link a table from access. using the menu option

data\import external data\import data

within excel. this will import data direct from excel. You can then right click the imported data and click refresh to update it at any time from access or write some code to do this automatically on open.
 
Ok many thanks for the ideas
I'll have a go with these.

rgds
nick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top