Export to Excel

A

Ang

Hi,

I am trying to export from Query to Excel Spreadsheet without seeing Query.
I did open Query but not exporting to Excel Spreadsheet. I have a list of
queries that should export to Excel Spreadsheet.

Your help would be much appreciated.
Thanks.
Ang

*********************************************************************
Private Sub cmdExportToExcel_Click()
On Error GoTo Err_cmdExportToExcel_Click

Dim RetVal
DoCmd.OpenQuery Me!lstQuery
DoCmd.TransferSpreadsheet acExport, 8, , "C:\Temp\test", True, ""
RetVal = Shell("C:\Program Files\Microsoft Office\office\excel.exe
C:\Temp\test.xls", 1)

Exit_cmdExportToExcel_Click:
Exit Sub

Err_cmdExportToExcel_Click:
MsgBox Err.Description
Resume Exit_cmdExportToExcel_Click
End Sub
**********************************************************************
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top