Search code examples
excelvbamacosstatusbarexcel-2011

Does `Application.StatusBar` work in office 2011?


I wrote this little macro on my mac using office 2011. I don't see any status bar. Anyone know why this is not working?

Sub testStastusBar()

    Application.DisplayStatusBar = True
    Application.StatusBar = "Now processing...."

    Dim n As Integer
    For n = 1 To 10
        Application.Wait (Now + TimeValue("0:00:01"))
        Debug.Print n
    Next n

    Application.StatusBar = False

End Sub

Solution

  • To make it work with Excel 2011, add DoEvents after updating the statusbar.

    Sub testStastusBar()
    
        Application.DisplayStatusBar = True
        Application.StatusBar = "Now processing...."
    
        DoEvents '<~~ Add This
    
        Dim n As Integer
        For n = 1 To 10
            Application.Wait (Now + TimeValue("0:00:01"))
            Debug.Print n
        Next n
    
        Application.StatusBar = False
    
    End Sub