Thread: UserForm Issue
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 UserForm Issue

Userforms are not part of any collection until they are loaded, so you need
to load them then refence it.

Load UserForm1

UserForms.Item(0).TextBox1.Text = "ABC"

--
HTH

Bob Phillips

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

"Thomas" wrote in message
...
Hi,

I am opening an excel spreadsheet with a userform from another application
(see code below) using late binding. I need to populate controls with

data.
How do I reference the userform?

Set objExcel = CreateObject("Excel.Application")
Set wbExcel = objExcel.Workbooks.Open("C:\test.xls")

I tried wbExcel.UserForm11.TextBox1.Text and it does not work. Any ideas?

Thanks