Export a Query to Excel

  • Thread starter Thread starter Jazz57
  • Start date Start date
J

Jazz57

Hi everyone

I need very badly to export a Query to an XLS .

The data are already OK in my Query. I use a button click to export them and
i want to code on the click event:

supose my query has the following name QryTest and i want to put it on the
following path in my PC C:\PRODUCT\queryxls.xls

I have been seeing some other posts but couldn't find any answer to my
question


Thanks for any help
 
Use the TransferSpreadsheet method or action. Look in VBA help. it will
explain exactly how to do this.
 
hi again

is there any example you can show me with the statement

Docmd.TransferSpreadsheet ...........................

Would apreciate very much

Thanks for your help.

i am seeing the help you mentioned and i am a little confused.

Thanks again

--
Adriano Santos



"Klatuu" escreveu:
 
DoCmd.TransferSpreadsheet acExport, , "QryTest","C:\PRODUCT\queryxls.xls",
True,

acExport means you are going to export the data

The blank after the acExport, is where you put the version of Excel. You
can leave this blank.

The next argument is the name of the query or table you want to export.

Then the path and file name where you want to save the spreadsheet.
 
1 small problem

i tried the command you told me but i received a messageafter the last comma

Command:
DoCmd.TransferSpreadsheet acExport,
,"QPorSector_Datas","C:\Producao\querytestexls.xls",true,

Message:
Expected Expression


What seems to be the problem ?

Thanks again for your help
--
Adriano Santos



"Klatuu" escreveu:
 
Back
Top