Skip to content

Commit

Permalink
xlswrite is fixed, tests for xlswrite are switched on
Browse files Browse the repository at this point in the history
  • Loading branch information
irublev committed Dec 28, 2018
1 parent b9b4262 commit 0a01ff2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/+modgen/+microsoft/+office/+test/mlunit_test_common.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
%
end
%
function DISABLED_test_xlswrite(self)
function test_xlswrite(self)
N_MAX_ROWS=65536;
N_MAX_COLS=256;
s=warning('off',...
Expand Down
11 changes: 10 additions & 1 deletion lib/+modgen/+microsoft/+office/xlswrite.m
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,16 @@
end

%Open file
ExcelWorkbook = Excel.workbooks.Open(file);
try
invoke(Excel.Workbooks,'Open',file);
catch
Excel.Quit;
Excel.delete;
clear Excel;
Excel = actxserver('Excel.Application');
invoke(Excel.Workbooks,'Open',file);
end
ExcelWorkbook = Excel.Workbooks.Open(file);
if ExcelWorkbook.ReadOnly ~= 0
%This means the file is probably open in another process.
error('MATLAB:xlswrite:LockedFile', 'The file %s is not writable. It may be locked by another process.', file);
Expand Down

0 comments on commit 0a01ff2

Please sign in to comment.