+ Reply to Thread
Results 1 to 10 of 10

Error help "Select Method of Range Class Failed"

  1. #1
    Forum Contributor mongoose36's Avatar
    Join Date
    06-10-2013
    Location
    Lincoln
    MS-Off Ver
    Excel 2013
    Posts
    389

    Error help "Select Method of Range Class Failed"

    Hi guys,

    Below is part of my code:
    Please Login or Register  to view this content.
    I'm trying to copy a range from one workbook and inserting that range into a table in another workbook, but it keeps throwing an error on line 3. Do I even need to select the body of the table to add a list row?
    If your questions has been answered to your satisfaction please don't forget to do the following:

    Add Reputation ... and ... Mark Thread as Solved

    Thanks,

    Ma 10:8b Freely you have received; freely give.

  2. #2
    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: Error help "Select Method of Range Class Failed"

    You can only select something on the active worksheet, which is in the active workbook. Not sure why you need to select at all, but

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

  3. #3
    Forum Contributor mongoose36's Avatar
    Join Date
    06-10-2013
    Location
    Lincoln
    MS-Off Ver
    Excel 2013
    Posts
    389

    Re: Error help "Select Method of Range Class Failed"

    That was my thought and I tried to change it to
    Please Login or Register  to view this content.
    outside of the with statement but that doesn't work either.

  4. #4
    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: Error help "Select Method of Range Class Failed"

    Does the Goto line work? How are the variables declared and initialized? What error do you get?

  5. #5
    Forum Contributor mongoose36's Avatar
    Join Date
    06-10-2013
    Location
    Lincoln
    MS-Off Ver
    Excel 2013
    Posts
    389

    Re: Error help "Select Method of Range Class Failed"

    Yes Goto did work, but it updates the screen to the selection even though I have screen Updating off. Is there a way to do this without selecting the table?

    My Variables are declared and initialized in a Public Variables module that is fired at the beginning of this code.

    One additional item I want the code to sort the table after inserting the new data, but the following throws an "Object doesn't support property or method."

    Please Login or Register  to view this content.

  6. #6
    Forum Contributor mongoose36's Avatar
    Join Date
    06-10-2013
    Location
    Lincoln
    MS-Off Ver
    Excel 2013
    Posts
    389

    Re: Error help "Select Method of Range Class Failed"

    Update...

    .DataBodyRange.Select
    only works if the destination worksheet is active. If the source worksheet is active the code fails

  7. #7
    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: Error help "Select Method of Range Class Failed"

    Quote Originally Posted by cplettner View Post
    Update...

    .DataBodyRange.Select
    only works if the destination worksheet is active. If the source worksheet is active the code fails
    Again, ...
    Quote Originally Posted by shg
    You can only select something on the active worksheet, which is in the active workbook.

  8. #8
    Forum Contributor mongoose36's Avatar
    Join Date
    06-10-2013
    Location
    Lincoln
    MS-Off Ver
    Excel 2013
    Posts
    389

    Re: Error help "Select Method of Range Class Failed"

    Ok is there another way to do what I am trying to do without selecting the range?

  9. #9
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Error help "Select Method of Range Class Failed"

    How does the code in post #3 not work?
    If posting code please use code tags, see here.

  10. #10
    Forum Contributor mongoose36's Avatar
    Join Date
    06-10-2013
    Location
    Lincoln
    MS-Off Ver
    Excel 2013
    Posts
    389

    Re: Error help "Select Method of Range Class Failed"

    OK now I'm really confused!!?? Norie, you must be a lucky charm! I went back to doing it that way and it worked fine, but I could have sworn it threw an error when I tried it that way before. Now that's working I need help with sorting the table. I'm using the following code to sort the table, but with no affect.
    Please Login or Register  to view this content.
    It throws the following error: "Application defined or Object Defined Error!"

+ 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. [SOLVED] macro to merge worksheets "select method of range class failed"
    By ShoshanaM in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-18-2013, 02:08 PM
  2. Excel VBA Runtime error 1004 "Select method of Range class failed"
    By jeskit in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-09-2012, 10:16 AM
  3. Select method of Range class failed" error message
    By Session101 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-13-2009, 11:50 AM
  4. "Select method of range class failed" error
    By RBI in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-22-2008, 10:28 AM
  5. Error Message "Select method of worksheet class failed"
    By philc in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-04-2005, 04: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