xlswrite in compiled program does not work.
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Sieghard
am 4 Jan. 2017
Beantwortet: Sieghard
am 4 Jan. 2017
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 Kommentare
Akzeptierte Antwort
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Spreadsheets finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!