TransferSpreadSheet problems

D

Don Brooks

When I try to use the doCmd.Transferspreadsheet acExport command to export
an access table to an Excel spreadsheet I don't get any errors but it does
NOT add any records to the spreadsheet. Instead it adds blank records the
the access table. I am executing these commands from a vbs file. To
prevent errors I had to create the spreadsheet before hand and insert the
field names into the first row. After that I don't get any errors, it just
doesn't work.

Set accessApp = CreateObject("Access.Application")
accessapp.OpenCurrentDatabase "g:\apps\rpmweb\webin\rpmenroll.mdb"
accessapp.DoCmd.TransferSpreadsheet acExport,8 , "rpmenroll",
"g:\apps\rpmweb\webin\rpmnrl.xls", true accessapp.CloseCurrentDatabase
accessApp.Quit
Set accessApp = Nothing

Any help would be GREATLY appreciated.
 
G

Guest

Try exchanging this...
DoCmd.TransferSpreadsheet acExport,8 , "rpmenroll"

for this..
docmd.TransferSpreadsheet acexport, acSpreadsheetTypeExcel8,"rpmenroll"

Greg
 

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