Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Moving from Excel 2003 to Excel 2000

Hi,

I am having hard time with a piece of my code.

I created object: objColMatches and in Excel 2003 code I can access items in
a following way: objColMatches(1) but Excel 2000 returns error message:
"Object doesn't support this property or method". When I tried something like
this: objColMatches.Item(i) (where i is declared as integer) I received
message: "Type mismatch". How can I access items in my object in Excel 2000?
Code must be interchangable between both: Excel 2000 and Excel 2003.

Thank you very much for your help.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Moving from Excel 2003 to Excel 2000

You haven't said what kind of object "objColMatches" is.
How did you instantiate it ?
I would guess it is a collection, but.. ?

NickHK

"Fornol" wrote in message
...
Hi,

I am having hard time with a piece of my code.

I created object: objColMatches and in Excel 2003 code I can access items

in
a following way: objColMatches(1) but Excel 2000 returns error message:
"Object doesn't support this property or method". When I tried something

like
this: objColMatches.Item(i) (where i is declared as integer) I received
message: "Type mismatch". How can I access items in my object in Excel

2000?
Code must be interchangable between both: Excel 2000 and Excel 2003.

Thank you very much for your help.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Moving from Excel 2003 to Excel 2000

This should clarify it:

Dim objRe As Object
Dim colMatches As Object

Set objRe = CreateObject("VBScript.RegExp")

objRe.Global = False
objRe.pattern = pattern 'pattern to compare with

Set colMatches = objRe.Execute(str) 'str is string to search for comparison

Execute method is used to extract a matches of a regular expressions from a
string.

"NickHK" wrote:

You haven't said what kind of object "objColMatches" is.
How did you instantiate it ?
I would guess it is a collection, but.. ?

NickHK

"Fornol" wrote in message
...
Hi,

I am having hard time with a piece of my code.

I created object: objColMatches and in Excel 2003 code I can access items

in
a following way: objColMatches(1) but Excel 2000 returns error message:
"Object doesn't support this property or method". When I tried something

like
this: objColMatches.Item(i) (where i is declared as integer) I received
message: "Type mismatch". How can I access items in my object in Excel

2000?
Code must be interchangable between both: Excel 2000 and Excel 2003.

Thank you very much for your help.




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Moving from Excel 2003 to Excel 2000

No expert on RegExp, but according to the link below, this is expected:

<http://www.regular-expressions.info/vbscript.html
The Execute method also takes one string parameter. Instead of returning
True or False, it returns a MatchCollection object. If the regex could not
match the subject string at all, MatchCollection.Count will be zero. If the
RegExp.Global property is False (the default), MatchCollection will contain
only the first match. If RegExp.Global is true, Matches will contain all
matches
</http://www.regular-expressions.info/vbscript.html

NickHK

"Fornol" wrote in message
...
This should clarify it:

Dim objRe As Object
Dim colMatches As Object

Set objRe = CreateObject("VBScript.RegExp")

objRe.Global = False
objRe.pattern = pattern 'pattern to compare with

Set colMatches = objRe.Execute(str) 'str is string to search for

comparison

Execute method is used to extract a matches of a regular expressions from

a
string.

"NickHK" wrote:

You haven't said what kind of object "objColMatches" is.
How did you instantiate it ?
I would guess it is a collection, but.. ?

NickHK

"Fornol" wrote in message
...
Hi,

I am having hard time with a piece of my code.

I created object: objColMatches and in Excel 2003 code I can access

items
in
a following way: objColMatches(1) but Excel 2000 returns error

message:
"Object doesn't support this property or method". When I tried

something
like
this: objColMatches.Item(i) (where i is declared as integer) I

received
message: "Type mismatch". How can I access items in my object in Excel

2000?
Code must be interchangable between both: Excel 2000 and Excel 2003.

Thank you very much for your help.






Reply
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
Excel 2003 files crashes when saving after moving another excel sh Helvetik Excel Discussion (Misc queries) 0 March 31st 08 05:43 PM
why is moving a row slow in excel 2007 where it is fast in 2000 charly Excel Worksheet Functions 0 March 10th 08 04:08 PM
Moving Macros from one computer to another Excel 2000 Michael J Davis Excel Discussion (Misc queries) 3 April 25th 07 12:56 AM
Upgrade from Excel 2000 to Excel 2003 without MS Office 2003? brigida3 Excel Discussion (Misc queries) 1 January 22nd 06 05:13 PM
Excel 2003 crashes loading excel files created Excel 2000 Jeff Lewin Australia Excel Discussion (Misc queries) 0 June 27th 05 04:20 AM


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

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

About Us

"It's about Microsoft Excel"