Excel extention not set

V

Vigil-Machque

I am trying to automate the export of a report to an Excel 97-2000 spread
sheet. The data is exported and the file is created however, the .xls
extention is not added to the file name. How can I get extention to be added
to the file name?

code I am using:
Private Sub Report_Activate()
DoCmd.OutputTo acReport, "HAN_in_Safe_Report", "MicrosoftExcelBiff8
(*.xls)", "HAN in Safe Report", True, "", 0
End Sub
 
T

Tatakau

I think maybe...

DoCmd.OutputTo acReport, "HAN_in_Safe_Report", "MicrosoftExcelBiff8
(*.xls)", "HAN in Safe Report.XLS", True, "", 0

Dunno. Add an XLS to your file name, and I think it'll work.

hth,

Nick
 
S

SusanV

Include it in the part where you name the file:

DoCmd.OutputTo acReport, "HAN_in_Safe_Report", "MicrosoftExcelBiff8
(*.xls)", "HAN in Safe Report.xls", True, "", 0
 
V

Vigil-Machque

Thank you for the help. It works perfectly.

Tatakau said:
I think maybe...

DoCmd.OutputTo acReport, "HAN_in_Safe_Report", "MicrosoftExcelBiff8
(*.xls)", "HAN in Safe Report.XLS", True, "", 0

Dunno. Add an XLS to your file name, and I think it'll work.

hth,

Nick
 

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