gpt4 book ai didi

vba - 在子 VBA 中停用 msgbox

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

Sub prelim()
MsgboX "Hello World"
End Sub


Sub Main()
Call prelim
End Sub

上述代码中 Sub prelim无法编辑。我在运行 Sub prelim 时需要 msgbox但是当我运行 Sub Main我不希望消息框弹出。怎么做?

最佳答案

如果不更改 Sub prelim,这是不可能的

Sub prelim(Optional silent As Boolean = True)
If Not silent Then MsgBox "Hello World"
End Sub


Sub Main()
prelim True 'no msgbox
prelim False 'with msgbox
prelim 'no msgbx
End Sub

关于vba - 在子 VBA 中停用 msgbox,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46115555/

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