LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Why CreateObject("vbscript.regexp") doesn't work?


If you have a reference set to the Regular Expressions library, you
don't need to use CreateObject. Just use the RegEx members as if they
were native VBA code. For example,

Dim RegEx As RegExp

You can also prefix the object name with the library name. I usually
do this for clarity and self-documentation but it usually isn't
necessary:

Dim RegEx As VBScript_RegExp_55.RegExp

This won't show up in the Project window because you are referencing
an COM DLL, not a workbook or XLA add-in. Only workbooks (and xla
add-ins are just workbooks) show up in the Project window.

You don't need to know the file name because you don't open the file.
The file is opened by VBA behind the scenes when necessary. If you
really want to know the file, enter the following in the Immediate
window and press ENTER:

?ThisWorkbook.VBProject.References("VBScript_RegEx p_55").FullPath

This will give you the file name, but there isn't anything you can do
with it.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional,
Excel, 1998 - 2010
Pearson Software Consulting, LLC
www.cpearson.com




On Thu, 15 Apr 2010 11:34:54 -0700, "Joe User" <joeu2004 wrote:

I get a runtime error ("object variable not set") pointing to the assignment
statement when I do the following:

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?

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I get the author of a file using CreateObject("Scripting.FileSystemObject")? Excel 009 Excel Programming 8 November 3rd 06 08:32 PM
Set OutApp = CreateObject("Outlook.Application") - Runtime error 429 Buffyslay Excel Programming 2 July 20th 05 05:06 PM
ASP: CreateObject("Excel.Application") IIS 6.0 Win2003 Mau[_2_] Excel Programming 0 July 20th 05 11:45 AM
Excel:Runtime Error 7 "Not enough Memory" with CreateObject (SAP.B sebastienm Excel Programming 0 July 24th 04 08:35 AM
CreateObject("Excel.Application") - Access denied Luca[_2_] Excel Programming 0 February 6th 04 01:21 PM


All times are GMT +1. The time now is 08:56 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"