I want to start PowerPoint instance, add a presentation to it in a way that has its window hidden (either a new one or existing one, both result in the same issue). However, I get run-time error in PowerPoint that says:
Application (unknown-member): Invalid request. There is no active presentation.
When a window is visible or there is already a PowerPoint instance open with at least one presentation it works without a problem. Moreover, when I click "End" in this Run-time error it correctly creates a presentation anyway. I tried using both NetOffice wrapper and Interop itself.
I'm using Office 2016 32-bit.
var app = new Application();
var ppt = app.Presentations.Add(Microsoft.Office.Core.MsoTriState.msoFalse);
// Or using NetOffice, which basically uses different namespaces
var netApp = new PowerPoint.Application();
var netPPt = netApp.Presentations.Add(MsoTriState.msoFalse);
I would like to be able to add presentation to the hidden window, as withnetApp.Presentations.Add(MsoTriState.msoTrue)
it works just fine.