Quantcast
Channel: Excel Help Forum - Excel Programming / VBA / Macros
Viewing all articles
Browse latest Browse all 49888

Close Userform from within child Userform

$
0
0
Hello everyone. I faced with a problem I cannot solve

I have a userform called "NewEngineer". In this Userform I have a textBox, and when "AfterUpdate" is triggered, child userform is displayed. Here user can enter additional data. There is a cancel button on a child userform. The button contains the simple code

Code:

Private Sub CancelButton_Click()
    Unload Me
    Unload NewEngineer
End Sub

But when I press that button (to close both userforms) I got Error

Code:

-2147417848 (800101108) Automation Error The object invoked has disconnected from its clients
When I press debug button on error message, the following libe of code is higlighted

Code:

Sub Macro22(control As IRibbonControl)
    NewEngineer.Show <<<<
End Sub

Note that This code located in a module

please help me to unload both userforms from within child userform when cancel button (on child userform) is pressed.



Viewing all articles
Browse latest Browse all 49888

Trending Articles