gpt4 book ai didi

excel - `Application.StatusBar` 是否在 Office 2011 中工作?

转载 作者:行者123 更新时间:2023-12-04 21:39:19 25 4
gpt4 key购买 nike

我用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

最佳答案

要使其适用于 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

关于excel - `Application.StatusBar` 是否在 Office 2011 中工作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20942334/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com