I'm busy writing some code that opens an existing excel file through
Matlab, copies some information from Matlab into the excel file, runs
an excel macro, and finally saves and exits the excel file.
I've got everything to work, but the problem is I get a prompt from
excel telling me that the spreadsheet file exists and asking me if
I'd like to save over it. I'd like to automatically answer yes and
not have the dialog box appear. I've pasted my code below, does
anyone have any ideas?
The problem occurs when I execute the command wdata.save;
Thanks in advance,
% Writes a matrix to an excel spreadsheet and then runs a macro
% Open excel
e = actxserver('Excel.Application');
% Open an existing spreadsheet
wdata = e.Workbooks.Open('C:\Program
% Make the first sheet active.
eSheets = wdata.Sheets;
eSheet1 = eSheets.get('Item', 1);
% Create a matrix
A = ceil(rand(3,3)*100);
% Copy the matrix into the first sheet of vba_test.xls
eActivesheetRange = e.Activesheet.get('Range', 'A1:C3');
eActivesheetRange.Value = A;
% Execute a macro
% Save the spreadsheet
% Quit Excel and delete the server.