View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Early and Late Binding Vba Excel

ActiveWorkbook.VBProject.VBComponents("forename") doesn't calls
the
initialize event of the form.


No it doesn't. Why would you think it would? From your earlier
reply, it seems to me you don't need to use the VBProject object
at all. What, exactly, are you trying to do?


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


"VJ" wrote in message
...
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