Listing Userform Names
That is because a user form does not exist in the userforms collection until
after it has been loaded.
--
HTH
Bob Phillips
(replace somewhere in email address with gmail if mailing direct)
"Nigel RS" wrote in message
...
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
|