Programmatically add reference to RegExp

T

TT

I want to be able to programmatically add a reference to the RegExp engine.
When I look at "Microsoft VBScript Regular Expressions 5.5" in the
References Dialog, the path is shown as
"c:\windows\system32\VBScript.Dll\3".It appears that I should be able to
programmatically set the reference with:
Application.AddIns.Add SomeString

but I can't figure out what should be passed ion SomeString.

Anyone know how to do this?

Thanks,
Tom
 
J

Jezebel

Add-ins and references are not the same thing. Add-ins are the files listed
on the Templates and Add-ins dialog. References are the files listed in
VBA's Tools > References. To add a reference you need something like

Application.VBE.ActiveVBProject.References.AddFromFile [Filename]

And in this case, the filename you want is indeed
"c:\windows\system32\VBScript.Dll\3". Try it.
 
T

TT

Thanks for the info. Unfortunately, it appears that I will never be able to
use this handy feature -- VBA is giving me an error message "Programmatic
accesss to VBA is not trusted". Lowering my security settings in Word to
"minimal" did not fix the problem. Perhaps this is an "improvement" I picked
up when I upgraded to XP Pro SP 2.
Jezebel said:
Add-ins and references are not the same thing. Add-ins are the files
listed on the Templates and Add-ins dialog. References are the files
listed in VBA's Tools > References. To add a reference you need something
like

Application.VBE.ActiveVBProject.References.AddFromFile [Filename]

And in this case, the filename you want is indeed
"c:\windows\system32\VBScript.Dll\3". Try it.





TT said:
I want to be able to programmatically add a reference to the RegExp
engine. When I look at "Microsoft VBScript Regular Expressions 5.5" in the
References Dialog, the path is shown as
"c:\windows\system32\VBScript.Dll\3".It appears that I should be able to
programmatically set the reference with:
Application.AddIns.Add SomeString

but I can't figure out what should be passed ion SomeString.

Anyone know how to do this?

Thanks,
Tom
 
H

Howard Kaikow

i believe that you have to check "Trust Access to VB Oroject" on the
"TRusted Sources" tab of the security dialog.

--
http://www.standards.com/; See Howard Kaikow's web site.
TT said:
Thanks for the info. Unfortunately, it appears that I will never be able to
use this handy feature -- VBA is giving me an error message "Programmatic
accesss to VBA is not trusted". Lowering my security settings in Word to
"minimal" did not fix the problem. Perhaps this is an "improvement" I picked
up when I upgraded to XP Pro SP 2.
Jezebel said:
Add-ins and references are not the same thing. Add-ins are the files
listed on the Templates and Add-ins dialog. References are the files
listed in VBA's Tools > References. To add a reference you need something
like

Application.VBE.ActiveVBProject.References.AddFromFile [Filename]

And in this case, the filename you want is indeed
"c:\windows\system32\VBScript.Dll\3". Try it.





TT said:
I want to be able to programmatically add a reference to the RegExp
engine. When I look at "Microsoft VBScript Regular Expressions 5.5" in the
References Dialog, the path is shown as
"c:\windows\system32\VBScript.Dll\3".It appears that I should be able to
programmatically set the reference with:
Application.AddIns.Add SomeString

but I can't figure out what should be passed ion SomeString.

Anyone know how to do this?

Thanks,
Tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top