View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default Listing Userform Names

This will return nothing in most instances, unless the userforms have been
loaded.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Alok" wrote in message
...
I know you are looking for an explanation to your question. I do not have
that. However, you could iterate through the forms like this(if they are
already loaded)

For i = 1 To UserForms.Count
Debug.Print UserForms(i - 1).Name
Next i


"Nigel RS" wrote:

Hi All
I am trying to list all userform controls. Part of this process requires
that I also show the userform name and caption.
In testing I discover an anomoly, that I cannot resolve - the first test
below works and correctly prints the userform name and caption. the

second
does not work - can someone explain why please?

' this works
Debug.Print ufReport.Name, ufReport.Caption

' this does not work?
Dim uf As UserForm
Load ufReport
For Each uf In UserForms
Debug.Print uf.Name, uf.Caption
Next
Unload ufReport