Suppose I wish to set reference to "Micosoft Visual Basic for Extensibility5.0". How do I accomplish this programmatically?
TIA
Myles
Suppose I wish to set reference to "Micosoft Visual Basic for Extensibility5.0". How do I accomplish this programmatically?
TIA
Myles
http://support.microsoft.com/kb/160647/en-us
XL97: How to Programmatically Create a Reference
set a reference manually and then query it for the file
? thisworkbook.VBProject.References("vbide").FULLPATH
C:\PROGRAM FILES\COMMON FILES\MICROSOFT SHARED\VBA\VBEEXT1.OLB
FOR EXAMPLE
or try the GUID
? thisworkbook.VBProject.References("vbide").Guid
{0002E157-0000-0000-C000-000000000046}
possibly.
This was from Excel 97, so try it in your version.
--
regards,
Tom Ogilvy
"Myles" <Myles.25o4im_1144033802.5836@excelforum-nospam.com> wrote in
message news:Myles.25o4im_1144033802.5836@excelforum-nospam.com...
>
> Suppose I wish to set reference to "Micosoft Visual Basic for
> Extensibility5.0". How do I accomplish this programmatically?
>
> TIA
>
> Myles
>
>
> --
> Myles
> ------------------------------------------------------------------------
> Myles's Profile:
http://www.excelforum.com/member.php...o&userid=28746
> View this thread: http://www.excelforum.com/showthread...hreadid=529064
>
Thanks Tom for the lead. It does help in setting reference to a WorkBook and from what I gleaned from the link, I tried the following line for settting the reference to "Microsoft Visual Basic for Applications Extensibility 5.3" and came up with "Method VBE of object_Application failed" error.
Set x = Application.VBE.ActiveVBProject _
.References("Microsoft Visual Basic for Applications Extensibility 5.3")
Myles.
You need to use the name of the Extensibility project
Set x = Application.VBE.ActiveVBProject.References("VBIDE")
--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
"Myles" <Myles.25pzez_1144120502.0949@excelforum-nospam.com>
wrote in message
news:Myles.25pzez_1144120502.0949@excelforum-nospam.com...
>
> Thanks Tom for the lead. It does help in setting reference to a
> WorkBook
> and from what I gleaned from the link, I tried the following
> line for
> settting the reference to "Microsoft Visual Basic for
> Applications
> Extensibility 5.3" and came up with "Method VBE of
> object_Application
> failed" error.
>
> Set x = Application.VBE.ActiveVBProject _
> References("Microsoft Visual Basic for Applications
> Extensibility 5.3")
>
> Myles.
>
>
> --
> Myles
> ------------------------------------------------------------------------
> Myles's Profile:
> http://www.excelforum.com/member.php...o&userid=28746
> View this thread:
> http://www.excelforum.com/showthread...hreadid=529064
>
Chip,
I am a bit at sea here. I need the line of code to set the reference to "Microsoft Visual Basic for Applications Extensibility 5.3" programmatically and with the same effect as the manual approach ie the requisite checkbox in the Reference dialogbox becomes ticked.
Set x = Application.VBE.ActiveVBProject.References("VBIDE" ) fails to achieve that.
Myles.
I have had some visitation from Gurus Tom & Chip but am still not able to get what I want. Namely, the code-quivalent of manually settting VBE reference to "Microsoft Visual Basic for Applications Extensibility 5.3" or "SOLVER" for that matter.
Thanks for any help.
Myles
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks