How do I disable the 'Do you want to save...' message box that pops up in Excel when I invoke a save using ActiveX in MATLAB 7.7 (R2008b)?

4 views (last 30 days)
I am using ActiveX to connect to Excel using a workflow similar to the one below:
Excel = actxserver('Excel.Application');
Workbook = Excel.Workbooks;.
When I save the workbook using the below code:
invoke(Workbook,'SaveAs',[pwd '\' filename]);
I get a message box that pops up in Excel asking me to confirm if I would like to save the Workbook as what I have specified in variable 'filename'. How do I disable this message box and just force Excel to save it as what I have specified?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 28 Sep 2009
To disable the message box that pops up in Excel, please set the DisplayAlerts property of the ActiveX connection to 'false' as shown in the following code:
Excel = actxserver('Excel.Application');
Excel.DisplayAlerts = 0;

More Answers (0)

Products


Release

R2008b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!