Is it possible to suppress screen updates while a PowerPoint macro is running?

C

Chirag

You can freeze the PowerPoint window to prevent it from showing the updates
using the LockWindowUpdate(). You can freeze the entire desktop from showing
the updates by using that API with GetDesktopWindow() API as follows:

---
Private Declare Function GetDesktopWindow Lib "user32" () As Long
Private Declare Function LockWindowUpdate Lib "user32" ( _
ByVal hwndLock As Long) As Long

Sub DoSomeJob()
On Error Resume Next

LockWindowsUpdate GetDesktopWindow()

'
' Do the tasks here.
'

LockWindowsUpdate 0
End Sub
---

The entire desktop would be frozen while the VBA code runs. The
LockWindowsUpdate with parameter 0 would unfreeze it.

Turning the display monitor on and off is a different thing. After using the
above code, would you still require it?

- Chirag

PowerShow - View multiple PowerPoint slide shows simultaneously
http://officeone.mvps.org/powershow/powershow.html
 
D

david.f.jenkins

No, no - I don't want to turn the display off - just don't want the
updates to show while the macro is running. Thanks for the code!
 
P

Patrick Bielen

Hi David,

And if so, how does one turn the display off and on?

Not sure how it works in powerpoint, but in excel that
can be reached by using Application.ScreenUpdating = False

Give it a try.

Mvg

Patrick
MCP / SCJP
 
Top