`Application.StatusBar`是否在2011办公室工作?

时间:2014-01-06 03:08:52

标签: excel-vba statusbar excel-vba-mac excel-2011 vba

我使用office 2011在我的mac上写了这个小宏。我没有看到任何状态栏。有谁知道为什么这不起作用?

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

1 个答案:

答案 0 :(得分:4)

要使其与Excel 2011一起使用,请在更新状态栏后添加DoEvents

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