Export query to Excel using VBA

  • Thread starter Thread starter Jordan
  • Start date Start date
J

Jordan

Currently I am using:

=====================
Set MyFileName = "P:\Userdata\Jon Doe\Excel Docs\MyExcel.xls"
DoCmd.OutputTo acOutputQuery, "MyQuery", _
acSpreadsheetTypeExcel9, MyFileName, True

=====================
But for some reason Windows 2000 PCs running Access 2000 get

"Error 2282: The formats that enable you to output data as a Microsoft
Excel, rich-text format, MS-DOS text, or HTML file are missing from the
Windows Registry"

When I run the DoCmd.OutputTo command. Is there another way to have a Query
fire up and export to excel?
 
Jordan said:
Currently I am using:

=====================
Set MyFileName = "P:\Userdata\Jon Doe\Excel Docs\MyExcel.xls"
DoCmd.OutputTo acOutputQuery, "MyQuery", _
acSpreadsheetTypeExcel9, MyFileName, True

Is there another way to have a Query
fire up and export to excel?

Sure is:

SELECT *
INTO
[Excel 8.0;Database=P:\Userdata\Jon Doe\Excel Docs\MyExcel.xls;].ExcelTableName
FROM MyQuery
;

Jamie.

--
 
Back
Top