View Full Version : Excel Spread sheet instead of report


gbanks
03-04-2005, 04:13 AM
I have a query that I want to export as an excel spread sheet. I know how to do this manually but is the a process that would automate this. Thanks..

cstahlberg
03-04-2005, 09:23 AM
Try a button with code that looks like this:

sub excelexport

queryname = inputbox("What is the name of the query you want to import?")
filelocation = inputbox("Where do you wan to put the file (path/fielname)?")
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel4, queryname, filelocation, True

end sub