问题
I have a userform with 2 frames. Each frame has a command button that adds a frame to that parent frame.
On the first command button click event the addition is successful, but on the 2nd I get an error.
Private Sub frame1Button_Click()
'add frame to frame 1
Set frm = Me.Frame1.Controls.Add("Forms.Frame.1", "1")
End Sub
Private Sub frame2Button_Click()
'add frame to frame2 - this generates error
Set frm = Me.Frame2.Controls.Add("Forms.Frame.1", "2")
End Sub
The error is:
description: "Automation error
The object invoked has disconnected from its clients."
Number: -2147417848
来源:https://stackoverflow.com/questions/46879572/userform-control-error-object-invoked-has-disconnected-from-its-clients