How can I disable the "update links" prompt when using XLSREAD in MATLAB 7.0.4 (R14SP2)?

5 views (last 30 days)
I am trying to read an excel file using XLSREAD. However, MATLAB prompts me with the dialog asking whether to update the links. I do not want this prompt to come up every time I use XLSREAD. I would like to disable this prompt from MATLAB without using the "basic" mode.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 8 Feb 2011
You can open the workbook as a ActiveX server in MATLAB and set the "AskToUpdateLinks" property to '0' before using the XLSREAD or XLSWRITE functions to read or write to the workbook. The following example illustrates this procedure:
Excel = actxserver('Excel.Application');
set(Excel,'AskToUpdateLinks',0) % Prevents the pop-up.
Workbooks = Excel.Workbooks.Add('C:\Temp\Book1.xls');
% Saving with the 'AskToUpdateLinks' property set to 0 disables the pop-up.
Workbooks.SaveCopyAs('C:\Temp\Book1.xls');
Workbooks.Close(false);
% Since the pop-up has been disabled, you can write without invoking the pop-up.
A = [1 2; 3 4];
xlswrite('C:\Temp\Book1.xls',A,'A1:B2');

More Answers (0)

Products


Release

R14SP2

Community Treasure Hunt

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

Start Hunting!