outputto excel error

N

neo0210

Dear all,

When I use "docmd.outputto acOutputReport, Screen.ActiveReport.NAME,
acFormatXLS, GetProgDirPath + (Screen.ActiveReport.NAME) + ".xls", False" to
export report to excel file.
I can't open the excel file since it prompt " this file need repare,invalid
sheet name",and the sheet name is "recovered sheet1".
How can I get the right excel file when I use docmd.outputto?
and can I add the password to this excel file?
Thanks very much.
 
J

John Nurick

I suggest you use the Kill statement to delete the existing Excel file
before using DoCmd.OutputTo to create the new one.

DoCmd.OutputTo cannot apply a password to the Excel workbook it creates.
To do that, you'd need to write VBA code that launches Excel, opens the
workbook, and saves it with the password.
 

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