+ Reply to Thread
Results 1 to 7 of 7

Print a dynamic range, "Range of Object Failed

  1. #1
    Forum Contributor
    Join Date
    04-20-2017
    Location
    Iowa
    MS-Off Ver
    2007
    Posts
    212

    Print a dynamic range, "Range of Object Failed

    Hello once again,

    When this routine runs, it is giving me an error "Range of Object_Worksheet failed on the highlighted line of code. When debugging, it has the correct rows and columns defined and the locals window shows that the correct sheet is being selected. I created this by watching a you tube video and simply entering my worksheet names and ranges, his works, mine not so much.

    I've made a few changes based on this error by others and it still fails.

    Ideas?

    Please Login or Register  to view this content.

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,835

    Re: Print a dynamic range, "Range of Object Failed

    Try change to
    Please Login or Register  to view this content.

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,999

    Re: Print a dynamic range, "Range of Object Failed

    Probably just:
    Please Login or Register  to view this content.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Forum Contributor
    Join Date
    04-20-2017
    Location
    Iowa
    MS-Off Ver
    2007
    Posts
    212

    Re: Print a dynamic range, "Range of Object Failed

    Thank you both for the replies. However, I feel quite stupid. The problem was that the routine was in a module and not the sheet code, moving the routine to the correct place allows it to work properly. Still learning...

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,999

    Re: Print a dynamic range, "Range of Object Failed

    You're welcome. Thanks for the rep.

    Might work but I'm not convinced it does what you think it does. But, if it does, fine.



    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

  6. #6
    Forum Contributor
    Join Date
    04-20-2017
    Location
    Iowa
    MS-Off Ver
    2007
    Posts
    212

    Re: Print a dynamic range, "Range of Object Failed

    It does select the range as it's supposed to, now I need to finish the process by adding the printing statements if that's what you mean. That's my next challenge!

    While we're discussing this, how would I need to change the routine so it can be run from a command button on my Main Menu sheet?

  7. #7
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,835

    Re: Print a dynamic range, "Range of Object Failed

    If you run the code from other than "Parts" sheet, you need to change one more line
    Please Login or Register  to view this content.
    And replace
    Please Login or Register  to view this content.
    with
    Please Login or Register  to view this content.
    Last edited by jindon; 06-03-2017 at 06:18 AM.

+ 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. Replies: 3
    Last Post: 08-29-2016, 06:17 PM
  2. [SOLVED] "Method 'Range' of object '_worksheet' failed" when a different sheet is active
    By CO# in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-10-2014, 11:48 AM
  3. [SOLVED] Receiving a "Method 'Range' of object'_Global' failed" error
    By aloha31 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 07-17-2013, 06:51 PM
  4. [SOLVED] Name a dynamic range - Run-time error 1004 Method 'Range' of object'_Worksheet' failed
    By DavidBW in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-03-2012, 08:00 AM
  5. Getting "Method 'Range' of Object '_Global Failed" with Range...Select
    By murpat01 in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 05-14-2007, 03:51 PM
  6. [SOLVED] Excel-VBA: "1004 - Method 'Range' of object '_Global' failed"
    By THA in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-18-2005, 05:06 AM
  7. [SOLVED] "GoalSeek method of Range object failed" error message
    By Fixit_Steve in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-13-2005, 04:06 PM

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