AnsweredAssumed Answered

Set Wait Cursor with VBA

Question asked by Andrea Orlando on Sep 26, 2017
Latest reply on Oct 3, 2017 by Matt Bieringer



I want to set cursor to "wait"  when my VBA MACRO run (SolidWorks 2013); I have tried this code:


Private Const IDC_WAIT As Long = 32512&
Private Const IDC_ARROW As Long = 32514&
Private Declare PtrSafe Function LoadCursor Lib "user32" Alias "LoadCursorA" (ByVal hInstance As Long, ByVal lpCursorName As Long) As Long
Private Declare PtrSafe Function SetCursor Lib "user32" (ByVal hCursor As Long) As Long
Public Function SetCursorToWait(bWait As Boolean)
    If bWait = False Then
        SetCursor LoadCursor(0&, IDC_WAIT)
        SetCursor LoadCursor(0&, IDC_ARROW)
    End If
End Function


but don't work


Any suggestion ? thanks