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
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.

Thanks
Nick
 
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
redinvader3walking.gif
 
I am using Office 97

thanks again VBS

I think I understand but I may be back !

best rgds
Nick
 
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top