Rahul Gupta
Rahul Gupta

Reputation: 1802

Suppress MS Access Excel warning/error

I am trying to suppress the message window, I receive when I try to save the Excel from MS Access 2003.
I am getting the following error.
Report.xls is a Microsoft excel 95/5.0 workbook. Do you want to overwrite with latest excel format?
I want to set it to 'Yes' by default.
How can I achieve this in MS Access 2003? Thanks in advance.

Upvotes: 0

Views: 437

Answers (1)

99moorem
99moorem

Reputation: 1983

You could try something like

xlApp.application.displayalerts = false
xlApp.xlWB.SaveAs <NAME OF FILE>, FileFormat:=56
xlApp.xlWB.close true
xlApp.application.displayalerts = True

Change NAME OF APPLICATION to the filepath and filename of the xls you are saving.

xlApp should be the ref to Excel from Access, xlWB is the ref to the workbook itself. names may need to be changed to match your code but should be enough to get you on your way.

Upvotes: 1

Related Questions