export an access table into excel using vbscript
Posted on 2006-07-12
I have a protected database which does not let me add modules, macros, queries or specifications to it.
I need to export the table from the database called "maintable" to excel.
Because i cant add a specification i can't use DoCmd.TransferText, so used DoCmd.TransferSpreadsheet
I know the following code works if run from a module ....
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "maintable", "C:\test.xls", True
but when i put it into a vbscript then it doesnt work.
I get error saying ...
"The microsoft jet database engine could not find the object 'C:\test.xls'. Make sure the object exists and that you spell its name and the path name correctly
error code 800A0BC3
I cant figure out why this is happening. Any ideas?