I am writing a script that loops through a folder and creates graphs from some criteria, and then exports these to powerpoint. At the moment, creating 130 graphs takes 290 s
One workaround I found was to minimize the PPT window, and then use EnableWindow to prevent user input getting to it. Tested with Office 365, from VB.NET
Private Shared Function EnableWindow(ByVal hWnd As IntPtr, ByVal bEnable As Boolean) As Boolean
End Function
Private _pptApp As PowerPoint.Application
Public Property ScreenUpdating As Boolean
Get
Return _pptApp.WindowState=PpWindowState.ppWindowNormal
End Get
Set(value As Boolean)
If value Then
EnableWindow(_pptApp.HWND, True)
_pptApp.WindowState = PpWindowState.ppWindowNormal
Else
'need to make sure it is enabled otherwise changing the state throws an exception
EnableWindow(_pptApp.HWND, True)
_pptApp.WindowState = PpWindowState.ppWindowMinimized
EnableWindow(_pptApp.HWND, False)
End If
End Set
End Property