Results 1 to 4 of 4

Thread: Excel 97 & VBA Runtime Error 1004

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2004
    Posts
    2

    Excel 97 & VBA Runtime Error 1004

    Hello

    I have an excel spreadsheet with VB code in it and it works great and all the time on Excel 2000 and 2003.

    I am running it on Excel 97 and it seems to work the first time only.

    The following line gives me an error 1004, Failed to get the Find property of the Range class

    Set c = Worksheets("ListSTB").Range("A1:A100").Find(Riferimento, LookIn:=xlValues)

    The logic is this, by clicking on a push button, Worksheet ListSTB is searched for the value stored in thevariable Riferimento.
    It goesthrough this in a loop the first time successfully.

    If the user decides to redo it, it then fails.

    Can anyone help?

  2. #2
    Addicted Member
    Join Date
    Aug 2002
    Location
    Luton, UK
    Posts
    178

    Wink

    might be "lazy programming" (grin)
    Try :-
    Code:
    Set c = Worksheets("ListSTB").Range("A1:A100").Find(What:=Riferimento, After:=[A1], LookIn:=xlValues)
    Regards
    BrianB
    -------------------------------

  3. #3

    Thread Starter
    New Member
    Join Date
    Jul 2004
    Posts
    2

    Is it in Excel 97?

    Hi

    Thanks for your input. I had tried that and tried again. It still does not work the second time. I get a run time error 1004
    "Unable to get the Find property of the range class"

    It works all the time in Excel 2000 and above. Is there a problem with Find functionality in Excel 97?

    Thanks

  4. #4
    Addicted Member
    Join Date
    Aug 2002
    Location
    Luton, UK
    Posts
    178
    I work for a large company and we are still using 97 with no problems.

    I suggest you post the full code
    Regards
    BrianB
    -------------------------------

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width