application.displayalerts = false not working in module. (1 Viewer)

Poco_90

Registered User.
Local time
Today, 23:30
Joined
Jul 26, 2013
Messages
87
I am stuck with a bit of coding, that should be easy but cant figure it out.

I have a module that exports a query to XLSM and another that runs a macro in the XLSM and saves the file as XLSX.

All is working but, the file doesn't automatically save unless you click yes. You get the warning "The following features cannot be saved in Macro free workbooks....."

I have tried different ways of saving the XLSM file to XLSX as well as trying to turn the alerts off.

With Application.DisplayAlerts = False I have a "Method or Data member not found" Do I need to declare DisplayAlerts?

DoCmd.SetWarnings False doesn't work

Any ideas on where I am going wrong?
TIA,
Poco
 

JHB

Have been here a while
Local time
Tomorrow, 00:30
Joined
Jun 17, 2012
Messages
7,732
In which application do you use Application.DisplayAlerts, in Excel or MS-Access?
If in MS-Access, then you need to change (Application) to the the reference for the Excel application.
Code:
[B][COLOR=Red]ReferenceToTheExcelApplication[/COLOR][/B].DisplayAlerts
 

Poco_90

Registered User.
Local time
Today, 23:30
Joined
Jul 26, 2013
Messages
87
Thanks you JHB. I never thought of that.
xl.DisplayAlerts = False was waht I needed
Poco
 

Users who are viewing this thread

Top Bottom