Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Late binding with VBIDE

Is late binding possible with the VBIDE. For example I'd like to be able
to:

Dim MyObj as Object

and then

Set MyObj as New CreateObject("VBIDE.VBComponent")

rather than Dim MyObj as New VBIDE.VBComponent

but I get Run time error '429', ActiveX component can't create object, even
if I have a reverence set to Microsoft Visual Basic for Applications
Extensibility 5.3.

I can do this with the Scripting.FileSystemObject. Why not with this?
Does this mean that I will either have to instruct a user to add the
reference or use an installer to do it via the registry if I want to use
these functions on distributed software.

I found a discussion from 2002-12-09 which Chip Peterson and Rob Bovey
describe how late and early binding work however it doesn't explain the
above.


Tony



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Late binding with VBIDE

Just answered my own question again (More searches in the news group!)
I should be doing this

Dim MyObj as Object

And then

Set MyObj = ThisWorkbook.VBProject.VBComponents

and I also note that

Set MyObj = CreateObject("VBIDE.VBComponent")

I was using

Set MyObj as New CreateObject("VBIDE.VBComponent")

which doesn't work

As I said below I have found a lot of info about early and late binding in
another discussion so I'll study that to try to understand the differences
between the various syntax.

Tony



Dim
"Tony Seiscons" wrote in message
...
Is late binding possible with the VBIDE. For example I'd like to be able
to:

Dim MyObj as Object

and then

Set MyObj as New CreateObject("VBIDE.VBComponent")

rather than Dim MyObj as New VBIDE.VBComponent

but I get Run time error '429', ActiveX component can't create object,

even
if I have a reverence set to Microsoft Visual Basic for Applications
Extensibility 5.3.

I can do this with the Scripting.FileSystemObject. Why not with this?
Does this mean that I will either have to instruct a user to add the
reference or use an installer to do it via the registry if I want to use
these functions on distributed software.

I found a discussion from 2002-12-09 which Chip Peterson and Rob Bovey
describe how late and early binding work however it doesn't explain the
above.


Tony





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Late binding with VBIDE

You don't say what you want to do with the component, but this shows how to
delete a module with late-binding

Dim VBComp As Object

Set VBComp = ThisWorkbook.VBProject.vbcomponents("Module2")
ThisWorkbook.VBProject.vbcomponents.Remove VBComp

--

HTH

RP

"Tony Seiscons" wrote in message
...
Is late binding possible with the VBIDE. For example I'd like to be able
to:

Dim MyObj as Object

and then

Set MyObj as New CreateObject("VBIDE.VBComponent")

rather than Dim MyObj as New VBIDE.VBComponent

but I get Run time error '429', ActiveX component can't create object,

even
if I have a reverence set to Microsoft Visual Basic for Applications
Extensibility 5.3.

I can do this with the Scripting.FileSystemObject. Why not with this?
Does this mean that I will either have to instruct a user to add the
reference or use an installer to do it via the registry if I want to use
these functions on distributed software.

I found a discussion from 2002-12-09 which Chip Peterson and Rob Bovey
describe how late and early binding work however it doesn't explain the
above.


Tony





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
Late Binding help, Please Bud Dean Excel Programming 5 September 24th 04 04:31 AM
Late Binding Todd Huttenstine[_3_] Excel Programming 3 April 30th 04 11:01 AM
Late Binding Cindy Excel Programming 11 April 23rd 04 03:34 PM
EARLY binding or LATE binding ? jason Excel Programming 6 February 26th 04 04:57 PM
DAO Late Binding? Sharqua Excel Programming 2 January 4th 04 02:05 AM


All times are GMT +1. The time now is 03:43 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"