View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Fredrik Wahlgren Fredrik Wahlgren is offline
external usenet poster
 
Posts: 339
Default Automation Error in Excel VBA


"VJ" wrote in message
...
Hi,

I am getting the following err If I tried to access the properties of the
form during run time from another workbook.

Method 'Properties' of object '_VBComponent' failed -2147467259

Following is my code Set mynewform =
Workbooks(template_Name).VBProject.VBComponents.It em(module_Name)
With mynewform
For Each FormProperty In .Properties
If FormProperty.Name = "ShowModal" Then
FormProperty.Value = False
End If
Next
End With

But If I run the same code in debug mode, It works fine.

Can somebody suggest me any way around?

Thanks,



Have you set a reference to the VBA Extensibility library?

/Fredrik