Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dear members;
I have a "password" userform. The user can enter his password in a textbox and click OK or press Enter. The OK commandbutton and the Exit event resulting from pressing Enter both trigger the same procedure Check_Password to evaluate a users rights. When I insert a false password, the routine works fine for both clicking the OK commandbutton and when pressing Enter. The application closes. When I insert a valid password and press Enter, the routine works fine as well. But, when I insert a valid password and click the OK commandbutton, an error occurs telling me that "The object invoked disconnected from its clients". It seems to me that the routine fails because it fires the same procedure twice. Once after Clicking OK and in the same time because of the Exit event. Can it be because the Exit(ByVal cancel As MSForms.ReturnBoolean) event always comes before clicking the OK button ? Does it have to deal with losing or stealing focus ? If so, how must I solve this ? -- Mark Rosenkrantz --- Spreadsheet Solutions Witkopeend 24 1423 SN Uithoorn, Netherlands --- E: W: www.rosenkrantz.nl |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
OK;
I Found out. I had to add Cancel = true Thanks anyway. Mark. "Spreadsheet Solutions" wrote in message . .. Dear members; I have a "password" userform. The user can enter his password in a textbox and click OK or press Enter. The OK commandbutton and the Exit event resulting from pressing Enter both trigger the same procedure Check_Password to evaluate a users rights. When I insert a false password, the routine works fine for both clicking the OK commandbutton and when pressing Enter. The application closes. When I insert a valid password and press Enter, the routine works fine as well. But, when I insert a valid password and click the OK commandbutton, an error occurs telling me that "The object invoked disconnected from its clients". It seems to me that the routine fails because it fires the same procedure twice. Once after Clicking OK and in the same time because of the Exit event. Can it be because the Exit(ByVal cancel As MSForms.ReturnBoolean) event always comes before clicking the OK button ? Does it have to deal with losing or stealing focus ? If so, how must I solve this ? -- Mark Rosenkrantz --- Spreadsheet Solutions Witkopeend 24 1423 SN Uithoorn, Netherlands --- E: W: www.rosenkrantz.nl |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Automation Error : The Object Invoked Has Disconnected From Its Clients !! | Excel Programming | |||
help please!!! error "object invoked has disconnected from its cli | Excel Programming | |||
Automation Error: The Object Invoked Has Disconnected from Its Clients (Excel) | Excel Programming | |||
Automation Error: The Object Invoked Has Disconnected from Its Clients | Excel Programming | |||
The object invoked has disconnected from its clinets | Excel Programming |