View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Vj Vj is offline
external usenet poster
 
Posts: 54
Default Early and Late Binding Vba Excel

Hi Chip,

It seems to me that

ActiveWorkbook.VBProject.VBComponents("formName") doesnt calls the
initialize event of the form.

Thanks


"VJ" wrote:

I have four forms: form1, form2, form3 and form4

when click on cmdbtn on form1, form2 shows up and in the initialize event of
the form2 I am getting reference to either form3 or form4 depending upon the
logic. the name of the form4 is dynamic because I am importing the form4 from
another workbook.

I get the err in the initialize event of form2 where after getting reference
to form3 or form4 I use varName.show.

The varName referes to either form3 or form4 through binding.

Ur help would be appreciated.

Thanks

"Chip Pearson" wrote:

Your code works fine for me. Exactly what problem do you
encounter?


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"VJ" wrote in message
...
Does any one help me why I can't refer to the form with this
method in VBA
Excel.

dim var_sr_form_name as object
Set var_sr_form_name =
ActiveWorkbook.VBProject.VBComponents("formName")

I get error when I use

var_sr_form_name.show method to show the form

or try to access any component of the form.

Thanks in advance for ur help.

VJ