Screen Updating

  • Thread starter Thread starter Robert Homes
  • Start date Start date
R

Robert Homes

Any way to (a) freeze screen updating during part of a VBA code routine, and
(b) hide the window of a Presentation without closing the Presentation
itself?

Thanks.

Robert Homes
(e-mail address removed)
 
Use the LockWindowUpdate() and 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. Do you still require
hiding the presentation window?

- Chirag

PowerShow - View multiple PowerPoint slide shows simultaneously
http://officeone.mvps.org/powershow/powershow.html
 
Thanks for the answer to my question (a). Regarding (b), Yes, I would still
like to know how to hide the window for the active Presentation -- WITHOUT
closing the Presentation. (That way, I could re-display the Window to show
any changes to the Presentation, and avoid having to save, close, and reopen
the thing.
 
A straight-forward way to get the window out of user's view would be to
minimize it. Something like:

---
ActivePresentation.Windows(1).WindowState = ppWindowMinimized
---

should do the job. You might want to store the original state to restore it
later after the updates are applied. Minimize the window before freezing the
desktop.

- Chirag

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