+ Reply to Thread
Results 1 to 5 of 5

Run-time error '1004': PasteSpecial method of Range class failed

  1. #1
    Forum Contributor
    Join Date
    01-20-2014
    Location
    Greece
    MS-Off Ver
    20 yr. old Excel 2002!
    Posts
    710

    Run-time error '1004': PasteSpecial method of Range class failed

    Hi
    I recorded this macro by performing the steps.

    I copied a range from workbook1, switched to workbook2, activated record new macro, then edit paste special and ticked "values", ok. Stop recording.


    Sub test()
    '
    ' test Macro
    ' Macro recorded 2015-12-20 by GT
    '

    '
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False
    End Sub

    Then, I copy the same range off wb1, switched to wb2, run the macro and got this error.

    Any ideas?

    Thx

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,820

    Re: Run-time error '1004': PasteSpecial method of Range class failed

    Your macro uses 'PasteSpecial' to paste a 'Selection' but there is no 'Selection' indicated in the macro and there is no destination. I believe that your code would have to look something like this:
    Please Login or Register  to view this content.
    You need the macro to copy the range and then you need to specify the paste destination. Please note the two different extensions. The "xlsm" indicates that the workbook contains the macro. The macro also assumes that both workbooks are open.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  3. #3
    Forum Contributor
    Join Date
    01-20-2014
    Location
    Greece
    MS-Off Ver
    20 yr. old Excel 2002!
    Posts
    710

    Re: Run-time error '1004': PasteSpecial method of Range class failed

    The thing is that the range copied from WB1 is manually selected and is not fixed. As far as the target, let that be deemed the current active cell on WB2.
    In other words, paste special (values) clipboard contents to WB2 current active cell.

  4. #4
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,820

    Re: Run-time error '1004': PasteSpecial method of Range class failed

    In the Visual Basic Editor, click on 'Tools', then click on 'References" and then put a check mark beside 'Microsoft Forms 2.0 Object Library'. Copy your range as usual and then try this macro:
    Please Login or Register  to view this content.
    If the 'Microsoft Forms 2.0 Object Library' is not visible, add a blank userform to your project and that should make the Object Library visible. You can delete the userform if you wish.
    Last edited by Mumps1; 12-20-2015 at 03:19 PM.

  5. #5
    Forum Contributor
    Join Date
    01-20-2014
    Location
    Greece
    MS-Off Ver
    20 yr. old Excel 2002!
    Posts
    710

    Re: Run-time error '1004': PasteSpecial method of Range class failed

    Done. Still though

    Run-time error '1004':

    PasteSpecial method of Range class failed

    (If you get it, include a variation for inserting the copied range (shift cells down)

+ 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': PasteSpecial method of Range class failed
    By jaghuar in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-14-2015, 07:35 PM
  2. Run time error '1004': PasteSpecial method of Range class failed
    By BorisGRU in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-31-2014, 07:09 PM
  3. PasteSpecial method of range class failed error 1004
    By iwannabakat in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-05-2014, 08:51 PM
  4. [SOLVED] VBA Run-time error '1004': PasteSpecial method of Range class failed on 2nd run
    By hydz1213 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 03-05-2013, 11:05 AM
  5. Run-time error '1004' - PasteSpecial method of Range class failed
    By antonf in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 05-10-2010, 04:42 PM
  6. Run-Time error'1004' PasteSpecial Method of Worksheet class failed
    By gj in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-31-2006, 06:48 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