This bug has been fixed in Release 14 Service Pack 3 (R14SP3). For previous product releases, read below for any possible workarounds:
The following provides an example of opening an existing Excel file named example.xls and proceeding to write and read with it:
file = 'D:\Applications\MATLAB701\work\example.xls';
Excel = actxserver('Excel.Application');
Workbooks = Excel.Workbooks;
Excel.Visible=1;
Workbook=Workbooks.Open(file);
sheetnum=1;
data=rand(4);
range = 'F10:I13';
Sheets = Excel.ActiveWorkBook.Sheets;
sheet1 = get(Sheets, 'Item', sheetnum);
invoke(sheet1, 'Activate');
Activesheet = Excel.Activesheet;
ActivesheetRange = get(Activesheet,'Range',range);
set(ActivesheetRange, 'Value', data);
Range = get(Activesheet,'Range',range);
out = Range.value;
invoke(Workbook,'Save')
invoke(Excel,'Quit');
delete(Excel);
clear Excel;
Best Answer