View Single Post
 
Old 08-26-2022, 06:28 AM
BrianHoard BrianHoard is offline Windows 10 Office 2019
Advanced Beginner
 
Join Date: Jul 2022
Location: Haymarket, VA USA
Posts: 85
BrianHoard is on a distinguished road
Default How to show wait cursor during vba script?

I have some scripts that may take 30 seconds to run on large documents, so I want to show the hourglass/wait cursor.
I'm using the following code, but it doesn't have any effect. The cursor flashes rapidly back and forth between normal and wait. The same behavior if I comment this out. Am I missing some step to make this work?

Code:
' Set status bar text
StatusBar = ("Please wait...")

' Turn cursor to wait
System.Cursor = wdCursorWait
DoEvents

' My script runs here...

' Turn cursor back to normal.
StatusBar = ("Complete")
System.Cursor = wdCursorNormal
Reply With Quote