Find method fails in Excel 2003 ("Subscript out of range")

G

Guy Jara

I have encountered a curious anomaly, and a solve for it, that is
related to Excel 2003. There are 2 constants in the Excel VBA
environment that look almost alike: xlValue and xlValues. The first is
a constant associated with the Axis of the graph object (I believe).
The second is a constant used by the Find method of the Range object in
Excel.

I encountered a situation where code utilizing the Find method that was
running in Excel 2000 now bombed with a "Subscript out of range" error
when run on Excel 2003. The problem was that the original code used the
incorrect "xlValue" constant with the Find method, rather than the
appropriate "xlValues" constant. Excel 2000 seemed to take such
sloppiness in stride and actually worked despited receiving the wrong
parameter value. However, Excel 2003 is more finicky and bombed when
passed the incorrect constant.

So word to the wise. Excel 2003 is more finicky.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top