ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   VB Script Regular Expressions - Missing (https://www.excelbanter.com/excel-discussion-misc-queries/105487-vbulletin-script-regular-expressions-missing.html)

John Taylor

VB Script Regular Expressions - Missing
 
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



Bob Phillips

VB Script Regular Expressions - Missing
 
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)

"John Taylor" wrote in message
...
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





John Taylor

VB Script Regular Expressions - Missing
 
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

"Bob Phillips" wrote in message
...
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)

"John Taylor" wrote in message
...
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








All times are GMT +1. The time now is 04:15 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com