+ Reply to Thread
Results 1 to 6 of 6

Runtime Error 1004 "Active method of range class failed".

  1. #1
    Registered User
    Join Date
    08-14-2012
    Location
    AU
    MS-Off Ver
    Excel 2003
    Posts
    3

    Runtime Error 1004 "Active method of range class failed".

    Hi fellow excellers,

    Set up a command button that calls a sub routine.

    Getting a runtime error 1004 "Active method of range class failed".

    Error traced back to the following line of code:
    Worksheets(WORKSHEET_NAME).Range("E5").Activate

    What am i doing wrong?

    Thanks.

  2. #2
    Forum Expert
    Join Date
    09-27-2011
    Location
    Poland
    MS-Off Ver
    Excel 2007
    Posts
    1,312

    Re: Runtime Error 1004 "Active method of range class failed".

    Hi try this way:

    Please Login or Register  to view this content.
    Regards

    tom1977

    If You are satisfied with my solution click the small star icon on the left to say thanks.

  3. #3
    Registered User
    Join Date
    08-14-2012
    Location
    AU
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Runtime Error 1004 "Active method of range class failed".

    Hi tom1977,

    I've defined WORKSHEET_NAME as a constant, is this still okay?

    Public Const WORKSHEET_NAME = "REPORT LOOK UP (2)"

    Thanks.

  4. #4
    Forum Expert
    Join Date
    09-27-2011
    Location
    Poland
    MS-Off Ver
    Excel 2007
    Posts
    1,312

    Re: Runtime Error 1004 "Active method of range class failed".

    check this
    Please Login or Register  to view this content.

  5. #5
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Runtime Error 1004 "Active method of range class failed".

    hi new2excel2012, you will get that error for:

    Please Login or Register  to view this content.
    every time when the referenced sheet is not the active one.

    To avoid that error you can do this:

    Please Login or Register  to view this content.

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Runtime Error 1004 "Active method of range class failed".

    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1