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

cross tab query to excel sheet automatically 1

Status
Not open for further replies.

franksirvent

Programmer
Mar 8, 2002
358
GB
Hi there

I have a Cross Tab query.

i need this query to be open as Excel automatically either via visual code (preferably) or with macros

Any ideas ???
thanks in advance


 
Hi
Transferspreadsheet will do it.
[tt]DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "Crosstab", "Xtab", True[/tt]
So will OutputTo:
[tt]DoCmd.OutputTo acOutputQuery, "Crosstab", acFormatXLS, "Xtab.xls", True[/tt]
 
hi there

I still have a problem with this...

when I run the following code on the .MDB database it works perfectly...
-----------------------------------------------------
DoCmd.OutputTo acOutputQuery, "ExporttoExcel2_Tabla de referencias cruzadas", acFormatXLS, "c:\kn2002\Xtab.xls", True
------------------------------------------------------
However when I compile the database and make it an .mde I get the following error message when trying to run this line of code...
------------------------------------------------------
error 2046: the command 'run sql' isnt available now'
------------------------------------------------------

Any ideas ???
 
Hi
Absolutely no idea. I have tried this with Access 2000 and I have not had a problem. I even renamed my files as above! Perhaps you could post your problem in a new thread and see if someone picks it up? [sadeyes]
 
THANKS FOR CHECKING IT OUT
I'LL DO A NEW POSTING

THANKS AGAIN
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top