Why do I see "The RPC server is unavailable" when calling 'actxserver' from MATLAB?
8 ビュー (過去 30 日間)
古いコメントを表示
MathWorks Support Team
2022 年 9 月 28 日
回答済み: MathWorks Support Team
2022 年 9 月 28 日
I am using 'actxserver' in MATLAB to create a COM automation server to interact with Microsoft applications such as Word an Excel. However, when I try to execute my script for the second time, I will encounter the following error:
The RPC server is unavailable
採用された回答
MathWorks Support Team
2022 年 9 月 28 日
Reasons why you are seeing the "The RPC server is unavailable" error upon the second run of your script could be that:
(1) You are not properly closing the COM server at the end of your script. Please make sure your code looks like this:
e = actxserver('Excel.Application');
% interact with COM server
Quit(e)
delete(e)
See the following documentation for an example:
(2) You are not waiting long enough between the first and second runs of your script. It takes time for COM servers to quit, and if you try to create a new COM server while the previous one is being terminated, the new COM server will get attached to the old COM server.
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Use COM Objects in MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!