OutPutTo - not outputting

Maritza

Information *****
Local time
Today, 23:15
Joined
Nov 13, 2002
Messages
54
Based on all the treads in the Forum in ref to the OutputTo command this line should work, but it doesn't.

I have the following code in a command button under the click Event:

Docmd.OutputTo acOutputQuery, "NameOfQuery", acFormatXLS, "C:\Path To Document", True

When I click the command button it opens the spreadsheet (Excel 97) , but the data was not exported.

Any suggestions?

Maritza
 
Is this code exact?

Docmd.OutputTo acOutputQuery, "NameOfQuery", acFormatXLS, "C:\Path To Document", True

If this is the EXACT code you're using, that is the problem.

"NameOfQuery" means the name of the query like
"GetData" or "Qry_Fields". whatever query you're using.

"C:\Path to document" is the position of the file on your PC like

"c:\My Documents\myFile.xls"

If you already changed those, I don't know what else to think without more details.
PB
 
No, that was just to show my format. The following is my real code

DoCmd.OutputTo acOutputQuery, "qryIFMonthlySum", acFormatXLS, "C:\MyDocuments\Excel\AccessData", True

This is a simple DB, but we need to plot the results in a graph. I'm not impress with Access's graphing cap, so I want to export the data to an excel spreadsheet and graph from there.

Thanks for your help
 
Well, I don't see anything wrong with the code at first glance.

Could you post the table structure and explain what you want to export and I can try to build a demo on my machine and see how it goes. I do work M-F days and have no PC at home so if this is urgent, maybe repost for someone who will be available before Monday. If it can wait, I'd be happy to look in to it, Monday.
PB
 
Just checking in.

Did you get your concerns worked out? Still available to help.
PB
 
Put the .xls extenstion on the end of your Accessdata filename and things should work out just fine.
 
OutputTo

Thanks to both of you for your help. I work around the problem. The document that I wanted to export the data to was a workbook. Once I saved it as a worksheet it worked fine.

Can we used a command like OutputTo to export data to a workwook? Keep in mine that I'm require to develop in Access 97.

Maritza
 

Users who are viewing this thread

Back
Top Bottom