Effacer les filtres
Effacer les filtres

Make a presentation with actxserver without displaying the presentation

11 vues (au cours des 30 derniers jours)
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;

Réponse acceptée

Cris LaPierre
Cris LaPierre le 28 Avr 2023
Modifié(e) : Cris LaPierre le 28 Avr 2023
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));

Plus de réponses (1)

Cris LaPierre
Cris LaPierre le 25 Avr 2023
Changing
  • h.Visible = 1;
to
h.Visible = 0;
should do what you want.
  1 commentaire
jr1995
jr1995 le 28 Avr 2023
Using h.Visible = 0 causes the following error:
---------------
Invoke Error, Dispatch Exception:
Source: Microsoft PowerPoint
Description: Application.Visible : Invalid request. Hiding the application window is not allowed.
Help File:
Help Context ID: 0
Error in class_BasicPresentation_main_v01/makePresentation (line 29)
h.Visible = 0; %-> Does not work...
Error in timeseriesanalyze_v03_mod_VWGS (line 162)
presentation.makePresentation
---------------
Any suggestions?

Connectez-vous pour commenter.

Catégories

En savoir plus sur Use COM Objects in MATLAB dans Help Center et File Exchange

Produits


Version

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by