'经测试两者都没问题,你实际的源码没贴上来不能看真正的原因,下面是我测试通过的代码供参考:
Private Sub Command1_Click()
test1 Text1
MsgBox "继续"
test2 Text1
End Sub
Private Sub Command2_Click()
Dim a As VBControlExtender
Dim s As String
s = "RichText.RichTextctrl.1"
Licenses.Add s
Set a = Me.Controls.Add(s, "rtxt")
a.Top = 100
a.Left = 100
a.Visible = True
End Sub
Sub test1(myText As TextBox)
myText.Text = Now & "-TextBox"
End Sub
Sub test2(myText As Object)
myText.Text = Now & "-Object"
End Sub
textBox 是控件而不是对像