VB Script Regular Expressions - Missing

J

John Taylor

Hello,

I'm trying to run a macro (created by Harlan Grove), using Excel 97 under
Windows XP SP2, which requires "'Microsoft Scripting Runtime" and "Microsoft
VBScript Regular Expressions 1.0".

In the VBE under Tools, References, I can find the Scripting Runtime but not
the VBScript Regular Expressions listed.

As a result, the macro always stops when it gets to "Dim re As New RegExp".

I've searched various web sites and it seems that if VBScript is installed
(which it is, on my machine version 5.6) the reference should show up, but
it doesn't.

Could someone please tell me how to find the reference to Microsoft VBScript
Regular Expressions 1.0?

TIA

Regards,

John
 
B

Bob Phillips

Try this code

Dim re As Object
Set re = CreateObject("VBScript.RegExp")

rather than

Dim re As New RegExp

and see whether you still get that problem.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
J

John Taylor

Bob,

Thanks a heap; your suggestion worked like a charm. No sign of the problem
now.

Easy when you know how. :) I'm sure I could have searched for weeks and
not found any reference to doing what you suggested.

Regards,

John
 

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