Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Detecting if a userform is loaded

Is there a test to detect if a userform has been loaded
into memory?

Thanks,

Seth
  #2   Report Post  
Posted to microsoft.public.excel.programming
jaf jaf is offline
external usenet poster
 
Posts: 300
Default Detecting if a userform is loaded

Hi Seth,
If userform1 is nothing then msgbox "Form Not Loaded"
Or
If not userform1 is nothing then msgbox "Form Is Loaded"


--

John

johnf202 at hotmail dot com


"Seth" wrote in message
...
Is there a test to detect if a userform has been loaded
into memory?

Thanks,

Seth



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Detecting if a userform is loaded

as soon as you reference Userform1 in your code, if it isn't loaded, it gets
loaded. So Johns code would always show it is loaded.

You can check the userforms collection

Sub tester4()
Dim bLoaded as boolean
Dim frm
'Load UserForm1
For Each frm In UserForms
If UCase(frm.Name) = UCase("UserForm1") Then
MsgBox "Userform1 is loaded"
bLoaded = True
Exit For
End If
Next
If Not bLoaded Then
MsgBox "Userform1 is not loaded"
End If

End Sub

Run as is, then
Uncomment Load UserForm1

--
Regards,
Tom Ogilvy


jaf wrote in message
...
Hi Seth,
If userform1 is nothing then msgbox "Form Not Loaded"
Or
If not userform1 is nothing then msgbox "Form Is Loaded"


--

John

johnf202 at hotmail dot com


"Seth" wrote in message
...
Is there a test to detect if a userform has been loaded
into memory?

Thanks,

Seth





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Add-In appears to be loaded, but isn't ... Ray Excel Discussion (Misc queries) 6 October 21st 09 07:33 PM
Why do I still get "#NAME?" when I have loaded the Analysis Toolp. Jonathan Excel Worksheet Functions 1 February 2nd 05 06:39 PM
Determining if a Add-In has been loaded from XLSTART Karl Kawano Excel Programming 0 September 4th 03 02:47 AM
Determining if a Add-In has been loaded from XLSTART Karl Kawano Excel Programming 0 September 3rd 03 11:35 PM
How to hide a loaded .xls...? faustino Dina Excel Programming 1 August 2nd 03 02:52 AM


All times are GMT +1. The time now is 08:15 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"