Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Run Time Error on Closing UserForm
Hello,
I have a userform with a cancel button on it. If I select that button, the program ends as it is supposed to. However, if I select the red X in the upper right hand side, I get the following (which occurs at userform.hide): Run Time Error '-2147418105 (800100007)' Automation Error The callee (server [not server application] is not available and disappeared; all connections are invalid. The call may have executed. Any ideas? I did had a button that calls another userform for information, but then that is closed and it comes back to this one. Thanks, Bill |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Run Time Error on Closing UserForm
Hello Bill, You can determine which close button was chosen and skip UserForm.Hide if it was the window close button (red X). This information is made available in the UserForm_QueryClose event. Here is an example... Code: -------------------- Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer) If CloseMode = 0 Then Exit Sub 'Red X was clicked UserForm1.Hide End Sub -------------------- If the user clicks your close button, CloseMode will equal 1. Sincerely, Leith Ross -- Leith Ross ------------------------------------------------------------------------ Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465 View this thread: http://www.excelforum.com/showthread...hreadid=561736 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Run time error on Userform Show | Excel Programming | |||
Closing UserForm | Excel Programming | |||
closing a userform | Excel Programming | |||
Vba - automaticaly closing userform | Excel Programming | |||
Help with closing a UserForm | Excel Programming |