Discussion:
Programmatically add reference to RegExp
(too old to reply)
TT
2005-04-25 01:08:53 UTC
Permalink
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
Jezebel
2005-04-25 03:32:33 UTC
Permalink
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.
Post by 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
Application.AddIns.Add SomeString
but I can't figure out what should be passed ion SomeString.
Anyone know how to do this?
Thanks,
Tom
TT
2005-04-25 10:39:31 UTC
Permalink
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.
Post by 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.
Post by 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
Application.AddIns.Add SomeString
but I can't figure out what should be passed ion SomeString.
Anyone know how to do this?
Thanks,
Tom
Howard Kaikow
2005-04-25 13:52:08 UTC
Permalink
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.
Post by 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.
Post by 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.
Post by 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
Application.AddIns.Add SomeString
but I can't figure out what should be passed ion SomeString.
Anyone know how to do this?
Thanks,
Tom
Loading...