ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Why CreateObject("vbscript.regexp") doesn't work? (https://www.excelbanter.com/excel-programming/441709-re-why-createobject-vbscript-regexp-doesnt-work.html)

Ron Rosenfeld

Why CreateObject("vbscript.regexp") doesn't work?
 
On Thu, 15 Apr 2010 11:34:54 -0700, "Joe User" <joeu2004 wrote:

Dim v As Object
v = CreateObject("vbscript.regexp")

I have select Microsoft VBScript Regular Expressions 5.5 (also tried 1.0)
under Tools References.

But nothing is added under VBAProject \ References in the Project pane, as
there is when I select atpvbaen.xls for example.

Is that indicative of the root cause of the problem, perhaps a missing file?

What is the name of the file that contains the Microsoft VBScript Regular
Expressions 5.5 library?



You must SET an object.

Dim v as Object
set v = createobject("vbscript.regexp").

If you select Tools/References VBScript Regular Expressions 5.5, then one
syntax would be:

Dim v as RegExp
Set v = New Regexp
....
....
....
'and maybe
Set v = Nothing
--ron


All times are GMT +1. The time now is 09:16 AM.

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