Why does MATLAB 6.5.1 (R13) crash when I attempt to clear the contents of a range in an MS Excel spreadsheet via ActiveX/COM?

1 view (last 30 days)
I am trying to use the MATLAB 6.5.1 (R13SP1) ActiveX/COM interface to control Microsoft Excel. I am trying to clear the contents of a range in the spreadsheet. I am using the following code:
A2 = cell(2,2);
set(eActiveSheetRange, 'Value', A2);
MATLAB crashes whenever I issue that SET command.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
This behavior has been corrected in MATLAB 7.0 (R14). If you are using a previous version, read the following:
This has been verified as a bug in MATLAB 6.5.1 (R13SP1) in the way that it handles writing empty cell arrays to MS Excel spreadsheets via ActiveX/COM.
As a workaround with MATLAB 6.5.1 (R14), initialize the elements of the cell array as in either of the following two commands:
A2 = {[], []; [], []}
Or
A2 = {'', ''; '', ''}

More Answers (0)

Products


Release

R13SP1

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!