|
Are you sure you have Excel installed?
If so, here is the code I use to startup excel, use xlswrite1(), and
shutdown Excel:
%----- Open Excel for writing.
Excel = actxserver('Excel.Application');
if ~exist(excelFileName, 'file')
ExcelWorkbook = Excel.workbooks.Add;
ExcelWorkbook.SaveAs(excelFileName, 1);
ExcelWorkbook.Close(false);
end
Excel.Visible = true; % Make Excel visible.
% Open up workbook.
invoke(Excel.Workbooks, 'Open', excelFileName);
% Save the reference to this workbook so that we can later activate
it, in case we open multiple workbooks.
%wbNumber1 = Excel.ActiveWorkbook;
% Do the actual writing of the data to the open worksheet.
xlswrite1(excelFileName, dataArray, 'MySheetname', 'C3');
invoke(Excel.ActiveWorkbook,'Save'); % Save to disk.
% Shut down Excel.
Excel.Quit
Excel.delete
clear Excel; % Remove variable from workspace.
Good luck,
ImageAnalyst
|