+ Reply to Thread
Results 1 to 5 of 5

Method 'Range' of object'_ Worksheet' failed Error for a Label Placement

  1. #1
    Forum Expert
    Join Date
    09-11-2014
    Location
    Washington, DC
    MS-Off Ver
    2016
    Posts
    1,907

    Method 'Range' of object'_ Worksheet' failed Error for a Label Placement

    Hello all,

    Can't seem to sniff this one out...highlighted line below is what is spitting out the error:

    Please Login or Register  to view this content.
    Example workbook is also attached.
    Attached Files Attached Files
    Spread the love, add to the Rep

    "None of us are as smart as all of us."

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,864

    Re: Method 'Range' of object'_ Worksheet' failed Error for a Label Placement

    In your sample
    Please Login or Register  to view this content.
    is:
    Apple
    so it is rather natural that
    Please Login or Register  to view this content.
    fails


    I assume that you are trying to position your textbox relative to cells with texsts in your sheet, so I'd first search for the text:
    Please Login or Register  to view this content.
    PS. Please note that just fews row down you use Selection. ...
    It will fail if any other than Schedule sheet is active
    Last edited by Kaper; 03-10-2016 at 05:12 AM.
    Best Regards,

    Kaper

  3. #3
    Forum Expert
    Join Date
    09-11-2014
    Location
    Washington, DC
    MS-Off Ver
    2016
    Posts
    1,907

    Re: Method 'Range' of object'_ Worksheet' failed Error for a Label Placement

    Thanks for your quick help Kaper. I should have been more detailed and mentioned that there are named ranges which is how the code is currently finding which row to insert/bin data, which is why referencing ws2.Range("Apple") seems to work (when the code runs as-is, everything does get plotted, but the error still occurs after).

    I tried your method, and everything does plot as expected again...but the same line produces another error after running: Object variable or With block variable not set.

    Thoughts?

  4. #4
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,864

    Re: Method 'Range' of object'_ Worksheet' failed Error for a Label Placement

    I looked into named ranges list, and saw there no apples:
    Please Login or Register  to view this content.
    are sure that it is
    same line produces another error
    because you have another very similar line in part after
    Please Login or Register  to view this content.

  5. #5
    Forum Expert
    Join Date
    09-11-2014
    Location
    Washington, DC
    MS-Off Ver
    2016
    Posts
    1,907

    Re: Method 'Range' of object'_ Worksheet' failed Error for a Label Placement

    Hah! Problems with working with Example workbooks...The new code does take care of the error, but now is plotting more shapes than what is needed/in locations that are undesirable. I'm assuming it's something to do with the looping logic, which I'm investigating now, but maybe you know off the top of your head?

    Again, attached example for reference.
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. run time error 1004 - method range of object worksheet failed.
    By anuwers in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 02-29-2016, 05:29 PM
  2. Replies: 4
    Last Post: 03-17-2014, 04:51 PM
  3. [SOLVED] VBA | Advanced Filter | Run time error 1004 method range of object worksheet failed
    By williakm1013 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-05-2013, 08:30 PM
  4. [SOLVED] Error 1004 - Method Range of Object Worksheet Failed
    By mrbickelsworth in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-24-2013, 02:18 PM
  5. [SOLVED] Getting Error - Method Range of Object - Worksheet Failed - Help!
    By missit in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-19-2013, 05:38 PM
  6. Sorting Worksheet result in Error method 'Range' of object"_global' failed
    By Silverboyke in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-18-2012, 05:23 PM
  7. Range Question / error 1004: method Range of object Worksheet has failed
    By Paul in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-07-2005, 10:06 AM

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