0

We have some code where we are using Microsoft.Office.Interop.PowerPoint to export some dashboards. We are seeing issues where when we export the dashboard everything is working, but within 2 minutes or so ALL opened Power Points are automatically closed. It is like the main process on the OS for Power Point is killed.

We just now started noticing it with our applications with code that has been running for awhile.

Could a security patch or OS change possibly caused this?

 _powerPoint.Quit();

If we comment out the above line of code, early test, have proved that the all the Power Point files stay open after that 2 minute time.

Has anyone encountered this at all? Like earlier stated, I'm curious if an OS change has occurred with unintended consequences.

Thanks.

EylM
  • 5,967
  • 2
  • 16
  • 28
tvb108108
  • 398
  • 3
  • 19
  • 2
    Presumably you're instantiating new (or getting the existing) instance of PowerPoint.Application, there's only ever *one* of those running at a time (unlike Excel, for instance, which can have multiple Application instances). It seems reasonable to me that `Quit`ting the application class would cause the behavior you describe, though I haven't tested it. – David Zemens Jul 10 '19 at 19:14
  • 1
    @DavidZemens: Totally agree with you, but the .Quit() code has been in the code base for some time and NOW all of a sudden is causing all power point application documents to be closed within 2 minutes. So it seems like something has changed elsewhere. Make sense? – tvb108108 Jul 10 '19 at 19:38
  • Yes, I understand what you're saying :) but not sure how to go about confirming your suspicions. Do you get the same problem if you simply do `_powerPoint = null` instead of `.Quit()`? – David Zemens Jul 10 '19 at 20:43
  • @DavidZemens: :-) I went back to the code and did: `_powerPoint = null` instead of `.Quit()` and everything worked normally and all my power point files stayed opened. In our code base now, we just removed the `_powerPoint = .Quit()` code and everything seems to be working fine. Still curious what changed and where! – tvb108108 Jul 10 '19 at 21:29
  • Wish I had that answer for ya. I've done a *lot* of PPT development but not in C# and I can't figure out how to get the right assemblies referenced to test it on my end. If you can show some more code as a [MCVE] (i.e., just show how you're instantiating the application, creating one or two empty/blank Presentations, etc., without all the internal workings of your actual program) I might be able to give a better guess at the problem. – David Zemens Jul 10 '19 at 21:36
  • Is there any chance you were previously running under multiple accounts? An old hack to get multiple PowerPoint instances running at once was to run the second instance as a second, local user account. – dbc Jul 10 '19 at 22:51
  • 1
    @DavidZemens: I can try to do that, not sure when though. Might can this weekend! But I wouldn't mind doing that so I can see if it does it on a small app and let you look at it! Thanks again for the discussion and such. – tvb108108 Jul 11 '19 at 13:47
  • 1
    @dbc: I wouldn't think the accounts would be the issue because this is happening at our place of work AND on the customer site. Interesting information though. – tvb108108 Jul 11 '19 at 13:48
  • 1
    https://stackoverflow.com/questions/19663478/powerpoint-issue-when-quitting?rq=1 – David Zemens Jul 11 '19 at 13:59
  • @DavidZemens: Welp, that appears to be EXACTLY our situation! Wow, thank you. I'll pass this to my co-workers. This issue was brought up at our Monday Dev meeting! Of course, still doesn't get our end result of why all of a sudden it is happening, but maybe that will come up in time if an issue is found somewhere else (with a OS update etc.) Thanks again, David. – tvb108108 Jul 11 '19 at 14:11
  • 1
    There is (or was, maybe MS fixed it sometime in the last few years) a bug with Windows "preview" pane in File Explorer: if a Presentation is selected in Explorer and Preview Pane enabled, this actually *opens* PowerPoint silently, which can lead to some very unexpected (and difficult to troubleshoot) errors/problems, because this is not how Explorer works with any other Office applications. Just tossing that out there as another potential reason for quirky behavior. – David Zemens Jul 11 '19 at 15:35

0 Answers0