Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
If TextBox1.Text = "" Or TextBox1.Text = "False" Then msgbox("Filename invalid. Try again.",vbOKOnly)
我收到“编译器错误:预期:=”错误消息。
这是因为您只能在 VBA 中调用带括号或不带括号的Subs 。Call所以改成:
Sub
Call
MsgBox "Filename invalid. Try again.", vbOKOnly
或者,如果你更喜欢这种风格:
Call MsgBox("Filename invalid. Try again.", vbOKOnly)
(并且您收到错误的原因是因为它希望您将结果分配给一个变量,因此它需要一个=.)
=