+ Reply to Thread
Results 1 to 8 of 8

"Select method of range class failed" error

  1. #1
    Registered User
    Join Date
    09-13-2008
    Location
    Barrie, ON, CA
    Posts
    47

    "Select method of range class failed" error

    Hello,

    I have a macro that opens a specified woorkbook that changes every month. There are formulas which are pasted to range I1 of the new workbook to calculate the totals on this sheet. Everytime i run the code though, I get an error that says "Select method of range class failed" and Range("I1").Select is apparently the error. Here is the code... can anyone help?

    Please Login or Register  to view this content.
    Last edited by RBI; 10-22-2008 at 10:28 AM. Reason: mark as solved

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    I would declare Bkst as a Range, not a Variant.

    Does the range actually have a value in it?
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Valued Forum Contributor rwgrietveld's Avatar
    Join Date
    09-02-2008
    Location
    Netherlands
    MS-Off Ver
    XL 2007 / XL 2010
    Posts
    1,671
    I do not see anything wrong except that ActiveSheets.Paste
    should be ActiveSheet.Paste without the s
    Check if D27 contains data of this format Book1.xls and if the file is actually opened.
    Looking for great solutions but hate waiting?
    Seach this Forum through Google

    www.Google.com
    (e.g. +multiple +IF site:excelforum.com/excel-general/ )

    www.Google.com
    (e.g. +fill +combobox site:excelforum.com/excel-programming/ )

    Ave,
    Ricardo

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436
    Assume recently opened workbook as an activesheet that is,

    a worksheet and not a chart sheet
    is not protected so range I1 can be selected.
    Cheers
    Andy
    www.andypope.info

  5. #5
    Registered User
    Join Date
    09-13-2008
    Location
    Barrie, ON, CA
    Posts
    47
    Andy,

    I think you might have the answer there but im not quite sure i understand it fully... could you give me the code that your method is outlinning.

    Thanks
    Last edited by RBI; 10-22-2008 at 09:55 AM. Reason: Read new post after this thread

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    I misread your initial code.

    Maybe

    Please Login or Register  to view this content.

  7. #7
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436
    If you are running the code from a click event of a button on a worksheet make sure the button has the TakeFocusOnClick set to false.

  8. #8
    Registered User
    Join Date
    09-13-2008
    Location
    Barrie, ON, CA
    Posts
    47

    Semi fixed

    Hey guys,

    Aprreciate all the help... I still didn't figure it out so I made another macro that does the copy and pasting and called it at the end of the original macro... I used the same methods of refering to the newly opened workbook's range only this time it worked (go figure)...

    anyway Thanks again for the help

+ 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