Log in

View Full Version : screen flickering



Pete
09-19-2008, 12:37 AM
Hi Expert

Not sure how to solve this simple issue with powerpoint. Each time i run the macro the screen flickers the code is module "countrybook" i have added the command ScreenUpdating = False and true but still the same problem.....

how to i stop screen flickering on click macro button in Powerpoint????

and i cannot up load the ppt extention file is not accepted on this site.........

John Wilson
09-21-2008, 04:52 AM
Posting the macro would be a good start.

ScreenUpdating doesn't work in PowerPoint so it won't help. You should be able to upload zipped ppt files.

Paul_Hossler
09-21-2008, 08:07 AM
There's a way to emulate ScreenUpdating = False

http://skp.mvps.org/ppt00033.htm


'Sample Usage:
'Sub LongProcessingSub()
'
' ' Lock screen redraw
' ScreenUpdating = False'
'
' --- Long time consuming code
'
' Redraw screen again
' ScreenUpdating = True
'End Sub

Property Let ScreenUpdating(State As Boolean)
Static hwnd As Long
Dim VersionNo As String

' Get Version Number
If State = False Then
VersionNo = Left(Application.Version, InStr(1, Application.Version, ".") - 1)

' Get handle to the main application window using ClassName
Select Case VersionNo

Case "8" ' For PPT97:
hwnd = FindWindow("PP97FrameClass", 0&)

Case "9" ' For PPT2K:
hwnd = FindWindow("PP9FrameClass", 0&)
Case "10" ' For XP:
hwnd = FindWindow("PP10FrameClass", 0&)

Case "11" ' For 2003:
hwnd = FindWindow("PP11FrameClass", 0&)

Case "12" ' For 2007: Seems to work
hwnd = FindWindow("PP12FrameClass", 0&)

Case Else
Err.Raise Number:=vbObjectError + ERR_VERSION_NOT_SUPPORTED, _
Description:="Supported for PowerPoint 97/2000/2002/2003 only."
Exit Property
End Select
If hwnd = 0 Then
Err.Raise Number:=vbObjectError + ERR_NO_WINDOW_HANDLE, _
Description:="Unable to get the PowerPoint Window handle"
Exit Property
End If
If LockWindowUpdate(hwnd) = 0 Then
Err.Raise Number:=vbObjectError + ERR_WINDOW_LOCK_FAIL, _
Description:="Unable to set a PowerPoint window lock"
Exit Property
End If
Else
' Unlock the Window to refresh
LockWindowUpdate (0&)
UpdateWindow (hwnd)
hwnd = 0
End If
End Property



Paul