Why are my ActiveX handles to Microsoft Word not automatically freed when they lose scope in MATLAB 6.5 (R13)?

2 views (last 30 days)
Why are my ActiveX handles to Microsoft Word not automatically freed when they lose scope in MATLAB 6.5 (R13)?
Why do the DELETE or RELEASE functions not free my ActiveX handles to Microsoft Word in MATLAB 6.5 (R13)?
Based on the MATLAB 6.5 (R13) documenation, the ActiveX handles should be freed when they lose scope. But this does not seem to be true for Microsoft Word.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 20 Jan 2010
To properly remove the ActiveX object to the Word application involves the use of the QUIT function and then the DELETE function. Note that this is a feature of Microsoft Word and not related to our ActiveX controls.
Here is a simple example to properly free the ActiveX handle to Word:
h = actxserver('Word.Application');
invoke(h, 'quit');
delete(h);
If the above code is executed within a function MATLAB function, the DELETE function is not required.

More Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!