Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel 2003 files crashes when saving after moving another excel sh | Excel Discussion (Misc queries) | |||
why is moving a row slow in excel 2007 where it is fast in 2000 | Excel Worksheet Functions | |||
Moving Macros from one computer to another Excel 2000 | Excel Discussion (Misc queries) | |||
Upgrade from Excel 2000 to Excel 2003 without MS Office 2003? | Excel Discussion (Misc queries) | |||
Excel 2003 crashes loading excel files created Excel 2000 | Excel Discussion (Misc queries) |