Userform control error: object invoked has disconnected from its clients

喜夏-厌秋 提交于 2019-12-11 05:14:06

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!