Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
closing a userform
I have a case where my userform could either be open or closed. How do
find in which state it is. For example, if the userform is closed and try to close it, it is first initialised and then closed, which I don want to do. - Manges -- Message posted from http://www.ExcelForum.com |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
closing a userform
Hi Mangesh;
You can create a seperate sub that includes an error handling event. Call the form with either load or show and then you'll know it is open. If you want it closed then use unload and if you want it open then leave it as show. Thanks, Greg -----Original Message----- I have a case where my userform could either be open or closed. How do I find in which state it is. For example, if the userform is closed and I try to close it, it is first initialised and then closed, which I dont want to do. - Mangesh --- Message posted from http://www.ExcelForum.com/ . |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
closing a userform
First of all, thanks for the reply. Yes, but the problem is that when
want to close it, and its already closed, then I don't want to open i first and then close it. Currently, thats how I am handling it. - Manges -- Message posted from http://www.ExcelForum.com |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
closing a userform
If it is loaded, then it will be in the userforms collection
for each frm in Userforms if frm.name = "MyUserform" then unload frm end if Next If you reference a userform and it is not loaded, then it is immediately loaded (as you have observed/stated). This should avoid that. -- Regards, Tom Ogilvy "mangesh_yadav " wrote in message ... First of all, thanks for the reply. Yes, but the problem is that when I want to close it, and its already closed, then I don't want to open it first and then close it. Currently, thats how I am handling it. - Mangesh --- Message posted from http://www.ExcelForum.com/ |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
closing a userform
also, if you only have one form, you can look at
Userforms.count as an indicator as well. -- Regards, Tom Ogilvy "mangesh_yadav " wrote in message ... First of all, thanks for the reply. Yes, but the problem is that when I want to close it, and its already closed, then I don't want to open it first and then close it. Currently, thats how I am handling it. - Mangesh --- Message posted from http://www.ExcelForum.com/ |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
closing a userform
Thanks Tom, this is what I wanted. It works nicely.
- Manges -- Message posted from http://www.ExcelForum.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Userform won't show after closing another file | Excel Discussion (Misc queries) | |||
Vba - automaticaly closing userform | Excel Programming | |||
Closing the Userform when macro is running | Excel Programming | |||
userform titlebar and closing form | Excel Programming | |||
Help with closing a UserForm | Excel Programming |