1

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
Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
DBWeinstein
  • 8,605
  • 31
  • 73
  • 118
  • I have not used macros all that much. Do you just write them in Excel or do you have to use Visual Basic .NET? Seems like a simple question but I mostly use Java and C++ so the macros I have not used all that much. – Doug Hauf Feb 21 '14 at 21:51

1 Answers1

4

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
Siddharth Rout
  • 147,039
  • 17
  • 206
  • 250