Make a presentation with actxserver without displaying the presentation
조회 수: 11 (최근 30일)
이전 댓글 표시
Hello,
I am using the actxserver() method to make PowerPoint presentations from Matlab. Is it possible to create/ open a presentation without displaying the presentation (similar to invisable figures)? I am using the following code (a method within a class):
The Visible property throws an error.
actXserver = actxserver('PowerPoint.Application'); %Create an ActiveX object
%actXserver.Visible = 0; -> Does not work...
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;
댓글 수: 0
채택된 답변
Cris LaPierre
2023년 4월 28일
편집: Cris LaPierre
2023년 4월 28일
It seems the current way to do this in VBA code would use the following syntax
You can set WithWindow to false, which means the file that is opened will not be visible.
The following code worked for me. Note that you must include the full path to the presentation.
h = actxserver('PowerPoint.Application'); %Create an ActiveX object
pres = h.Presentations.Open(fullfile(path,ppt),0,0,0));
댓글 수: 0
추가 답변 (1개)
Cris LaPierre
2023년 4월 25일
See this example: https://www.mathworks.com/matlabcentral/answers/1793235-axes-box-incompletely-copied-to-clipboard#answer_1040800
Changing
- h.Visible = 1;
to
h.Visible = 0;
should do what you want.
참고 항목
카테고리
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!