Microsoft.Office.Interop.PowerPoint.Presentation.Close slows down over time

Mike Gabel 0 Reputation points
2024-01-12T23:15:14.3733333+00:00

I have a C# application that gets called as a command line task (e.g. "application.exe param1 param2"). The application uses the Microsoft.Office.Interop.PowerPoint package to merge several individual PowerPoint presentations together.

I've noticed that over time the process takes longer and longer to complete. I have wrapped all calls to functions in the Microsoft.Office.Interop.PowerPoint package in a timer and plotted the results over time to find that the Microsoft.Office.Interop.PowerPoint.Presentation.Close function has a very clear upward trend line.

Are there any reasons why this function would take longer the more times it is called or the more times PowerPoint is interacted with?

The only way to speed this up so far has been to delete the user profile of the user it runs under. I have tried deleting a variety of temp files but nothing that I've deleted so far as helped. I have also looked through the registry for any hints but have not come across any.

Any help would be very much appreciated; this one has me stumped.

Environment details:

  • Microsoft.Office.Interop.PowerPoint Package
    • Version: 5.0.4420.1017
    • Target Framework: net48
  • PowerPoint 2016
    • Version: 2311
  • OS
    • Windows Server 2019 (this has happened on Windows Server 2012 as well)
PowerPoint
PowerPoint
A family of Microsoft presentation graphics products that offer tools for creating presentations and adding graphic effects like multimedia objects and special effects with text.
301 questions
Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,963 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.