Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Automation Error in Excel VBA

If this is refering to a real template, the name of the workbook you are
refering to won't be the name of the template if it was opened with
File=New and then the template was specified.

--
Regards,
Tom Ogilvy

"VJ" wrote in message
...
Yes, I have referenced to Microsoft Visual Basic for application
extensibility for 5.3.

I am also able to compile it and and it works fine in the debug mode.

"Fredrik Wahlgren" wrote:


"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





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
automation error kills excel Simon Prince Excel Programming 2 December 18th 03 09:02 AM
Excel 2000 Automation Error Felix[_2_] Excel Programming 0 September 18th 03 04:56 AM
Excel 2000 Automation Error Bob Enagonio Excel Programming 1 September 17th 03 07:25 PM
Excel 2000 Automation Error Felix[_2_] Excel Programming 0 September 17th 03 04:03 PM
VB Excel Automation Error Sasanka Pinidiya Excel Programming 0 August 26th 03 08:11 AM


All times are GMT +1. The time now is 12:51 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"