Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi All
How can I test if a userform is loaded in memory? I have a userform that can be loaded and not visible or just not loaded. Before I manipulate the controls on the form I need to determine if it is memory. Thank You -- Cheers Nigel |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Nigel,
If UserForms.Count = 0 Then MsgBox "no forms are loaded" End If Regards, Peter T "Nigel" wrote in message ... Hi All How can I test if a userform is loaded in memory? I have a userform that can be loaded and not visible or just not loaded. Before I manipulate the controls on the form I need to determine if it is memory. Thank You -- Cheers Nigel |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
Thanks for the suggestion, in this case I think it will work. But I may have more than one form and wanted something to test for a specific form being in memory. Possible? something like If userform1.loaded then do what i need to do End If -- Cheers Nigel "Peter T" <peter_t@discussions wrote in message ... Hi Nigel, If UserForms.Count = 0 Then MsgBox "no forms are loaded" End If Regards, Peter T "Nigel" wrote in message ... Hi All How can I test if a userform is loaded in memory? I have a userform that can be loaded and not visible or just not loaded. Before I manipulate the controls on the form I need to determine if it is memory. Thank You -- Cheers Nigel |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
' for testing
' x = UserForm2.Caption ' loads if not already If UserForms.Count 0 Then For i = 0 To UserForms.Count - 1 Debug.Print UserForms(i).Caption, UserForms(i).Visible Next End If You could unload forms in the loop if necessary. Regards, Peter T "Nigel" wrote in message ... Hi Thanks for the suggestion, in this case I think it will work. But I may have more than one form and wanted something to test for a specific form being in memory. Possible? something like If userform1.loaded then do what i need to do End If -- Cheers Nigel "Peter T" <peter_t@discussions wrote in message ... Hi Nigel, If UserForms.Count = 0 Then MsgBox "no forms are loaded" End If Regards, Peter T "Nigel" wrote in message ... Hi All How can I test if a userform is loaded in memory? I have a userform that can be loaded and not visible or just not loaded. Before I manipulate the controls on the form I need to determine if it is memory. Thank You -- Cheers Nigel |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Just to add, if unloading forms loop like this
If UserForms.Count 0 Then For i = UserForms.Count - 1 To 0 Unload UserForms(i) Peter T "Peter T" <peter_t@discussions wrote in message ... ' for testing ' x = UserForm2.Caption ' loads if not already If UserForms.Count 0 Then For i = 0 To UserForms.Count - 1 Debug.Print UserForms(i).Caption, UserForms(i).Visible Next End If You could unload forms in the loop if necessary. Regards, Peter T "Nigel" wrote in message ... Hi Thanks for the suggestion, in this case I think it will work. But I may have more than one form and wanted something to test for a specific form being in memory. Possible? something like If userform1.loaded then do what i need to do End If -- Cheers Nigel "Peter T" <peter_t@discussions wrote in message ... Hi Nigel, If UserForms.Count = 0 Then MsgBox "no forms are loaded" End If Regards, Peter T "Nigel" wrote in message ... Hi All How can I test if a userform is loaded in memory? I have a userform that can be loaded and not visible or just not loaded. Before I manipulate the controls on the form I need to determine if it is memory. Thank You -- Cheers Nigel |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks - works a treat
-- Cheers Nigel "Peter T" <peter_t@discussions wrote in message ... Just to add, if unloading forms loop like this If UserForms.Count 0 Then For i = UserForms.Count - 1 To 0 Unload UserForms(i) Peter T "Peter T" <peter_t@discussions wrote in message ... ' for testing ' x = UserForm2.Caption ' loads if not already If UserForms.Count 0 Then For i = 0 To UserForms.Count - 1 Debug.Print UserForms(i).Caption, UserForms(i).Visible Next End If You could unload forms in the loop if necessary. Regards, Peter T "Nigel" wrote in message ... Hi Thanks for the suggestion, in this case I think it will work. But I may have more than one form and wanted something to test for a specific form being in memory. Possible? something like If userform1.loaded then do what i need to do End If -- Cheers Nigel "Peter T" <peter_t@discussions wrote in message ... Hi Nigel, If UserForms.Count = 0 Then MsgBox "no forms are loaded" End If Regards, Peter T "Nigel" wrote in message ... Hi All How can I test if a userform is loaded in memory? I have a userform that can be loaded and not visible or just not loaded. Before I manipulate the controls on the form I need to determine if it is memory. Thank You -- Cheers Nigel |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Keeping an add-in loaded | Excel Programming | |||
Extracting Colors from Image loaded in userform | Excel Programming | |||
how to know if a xla is 'loaded' | Excel Programming | |||
Excel: VBA userform is shown but not loaded/initialized even though it was first unloaded? | Excel Programming | |||
Detecting if a userform is loaded | Excel Programming |