xlswrite in compiled program does not work.
1 view (last 30 days)
Show older comments
I have a problem with a standalone application made with the Matlab compiler. The code in question is
function test
toXLS = cell(3,3);
toXLS{1,1} = 'Abcd';
toXLS{1,2} = 25;
toXLS{2,1} = 'Defg';
toXLS{2,2} = 33;
% generation of output GUI - I left out the part where this is filled with data
report=figure('Name','Calculation Results','NumberTitle','off');
% generate pushbutton in report to save to xls
buttonSave = uicontrol(report,'Style','pushbutton','Units','normalized','String','Export to XLS',...
'Callback',@report2xls,'Position',[0.02 0.02 0.46 0.10]);
% then a nested function to execute the saving of the data
function report2xls(varargin)
[Save2File,Save2Path] = uiputfile('*.xls','Save As...','OGU.xls');
Filename = fullfile(Save2Path,Save2File);
xlswrite(Filename,toXLS);
end
end
This works just fine when I run it in Matlab, I get a nice Excel file with the cell array data. However, after compiling it takes ages for the xls file to be written (I am talking about 5 min+ on a Quadcore i7) and the generated file is empty. Any ideas what my mistake is?
I have both Office 2010 and Office 2013 installed on the computer, might this be a source of error? Also, after invoking the function above an Excel process remains open in the task manager indefinitely.
Thanks a lot for your help,
Sieghard
0 Comments
Accepted Answer
More Answers (0)
See Also
Categories
Find more on Spreadsheets in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!