Excel 97 ADODB Recordset.Find "Invalid Use" error

R

Robin Hammond

Has anyone come across this. I am trying to migrate some code back to Excel
97 and getting compile errors with a statement using the Find method on a
recordset. e.g.
rsExpressions.Find "Name = 'rhammond'"
generates an "invalid use of object" error when compiled. I have a correct
reference to ADO 2.8 set. It's easy enough to get around using filters, but
I'd like to know if this is a local error or something that's been seen
before.

Thanks in advance,

Robin Hammond
www.enhanceddatasystems.com
 
B

Bob Flanagan

Try the following:

dim foundCell as range
Set foundCell = Nothing
Set foundCell = rsExpressions.Find ("Name = 'rhammond'")
if not foundCell is nothing then
do something
end if

Robert Flanagan
Macro Systems
Delaware, U.S. 302-234-9857
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel
 

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