Hi everyone
does anyone have a code which would enable me to send the results of a query to excel, say via a button on a form
(on click)
would appreciate any help on this as not mucho hair left.
What version of Access are you using.
If using 2002 then it is easy.
Choose the Tools menu... Office Links... Analyze it with Excel Thanks,
John McKenney
Work Hard... Play Harder
Try something like this:
[tt]
Sub cmdOutput_Click()
DoCmd.OutputTo acOutputQuery, "qryMyQuery", acFormatXLS, "C:\Test.xls", True
End Sub
[/tt] VBSlammer
Hiya VBS
I wonder if I may prevail upon your knowledge to go one step further with this send to Excel prob,
The code works just great thankyou and I was wondering if
you could help with the following.Everytime I send the Query results to Excel it starts a new Spreadsheet called
"test" which is fine, but is there a way to send the details
to a spreadsheet whci will just accept the new info.Rather than create a new one. the reason I ask is because I wanted to keep the existing charts I made In the Excel workbook and just have them update the chart whenever I sent the info
via your code.
Sorry if I have gone off the track here a bit.Most grateful of your help.
Best rgds
Nick
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.