Close PowerPoint with actxserver

Hello,
I am using the actxserver() method to make PowerPoint presentations from Matlab. Is it possible to close the presentation at the end? I am using the following code (a method within a class):
I am looking for a quit method. The Quit-method does not work. Whereas when using an actxserver('Excel.Application'), the Quit-method does work and Excel get closed.
actXserver = actxserver('PowerPoint.Application'); %Create an ActiveX object
obj.actserverPP_1 = actXserver;
actXinterface = actXserver.Presentation.Open( fullfile(obj.templatePath_1, obj.templateName_1) ); %Open an existing presentation by supplying the fullpath to the file
obj.presentationInterface_1 = actXinterface;
%Other code
% ...
% ...
% Here I want to close the presentation:
% something like
% obj.actserverPP_1.Quit -> The quit method does not work
clear actXserver actXinterface
obj.actserverPP_1 = []; %Clear activeserver
obj.presentationInterface_1 = []; %Clear interface

 採用された回答

Cris LaPierre
Cris LaPierre 2023 年 4 月 25 日
編集済み: Cris LaPierre 2023 年 4 月 25 日

0 投票

I think something like this should do it.
h = actxserver('PowerPoint.Application')
h.Quit
If not, you could try this.
invoke(h,'Quit')

1 件のコメント

jr1995
jr1995 2023 年 4 月 28 日
invoke(h, 'Quit') works perfectly. Thanks a lot

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeUse COM Objects in MATLAB についてさらに検索

製品

リリース

R2022a

質問済み:

2023 年 4 月 25 日

コメント済み:

2023 年 4 月 28 日

Community Treasure Hunt

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

Start Hunting!

Translated by