-
Notifications
You must be signed in to change notification settings - Fork 131
Open
Description
Hello everyone,
I'm currently working on a Java application that interacts with Microsoft PowerPoint using the JACOB (Java COM Bridge) library.
Here's the issue I'm encountering:
When I set the Visible property of the PowerPoint application to false, I receive the following error:
java.lang.RuntimeException: com.jacob.com.ComFailException: Invoke of: Visible
Source: Microsoft PowerPoint
Description: Application.Visible : Invalid request. Hiding the application window is not allowed.
Here's a snippet of my current code:
ComThread.InitSTA();
ActiveXComponent ppt = null;
Dispatch presentations = null;
Dispatch presentation = null;
ppt = new ActiveXComponent("PowerPoint.Application");
// ppt.setProperty("Visible", new Variant(true)); //only true can work
// ppt.setProperty("Visible",false); //not work
// ppt.setProperty("Visible", 0); //not work
presentations = ppt.getProperty("Presentations").toDispatch();
presentation = Dispatch.call(presentations, "Open", pptFilePath, new Variant(false),
new Variant(false), new Variant(false)).toDispatch();
Am I missing something?
Is there a better way to handle the visibility of the PowerPoint application window when using JACOB?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels