+ Reply to Thread
Results 1 to 10 of 10

Run-time error 1004 paste method of worksheet class failed

  1. #1
    Registered User
    Join Date
    05-01-2013
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    21

    Run-time error 1004 paste method of worksheet class failed

    I'm trying to run a macro but I'm getting the following error message:

    Run-time error 1004 paste method of worksheet class failed

    When I click debug on the error message window ActiveSheet.Paste is highlighted yellow. Can someone tell me what I may be doing wrong?

    Please Login or Register  to view this content.
    Attached Images Attached Images
    Last edited by arlu1201; 05-07-2013 at 12:41 PM. Reason: Changed HTML tags to code tags.

  2. #2
    Registered User
    Join Date
    04-22-2013
    Location
    The Netherlands
    MS-Off Ver
    Excel 2003/2007 & 2010
    Posts
    90

    Re: Run-time error 1004 paste method of worksheet class failed

    What are you trying to achieve? What are you copying and pasting? Some more code or workbook would be useful, hard to tell from this

  3. #3
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,528

    Re: Run-time error 1004 paste method of worksheet class failed

    Like Martijn said, more code would certainly help

    You don't need (and want) to select when copying/pasting.

    Please Login or Register  to view this content.
    will copy range A1:A5 of the active (visible) sheet and paste it in cell B1 (B1:B5) of the active sheet.

    If you want to paste from the active sheet into a different (non active) sheet, you can use

    Please Login or Register  to view this content.
    There are multiple ways to accomplish this but more info is required

  4. #4
    Registered User
    Join Date
    05-01-2013
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    21

    Re: Run-time error 1004 paste method of worksheet class failed

    Martin & Jolivanes -

    At the end of every month there is a report that I run off of MS Access, which I export to Excel. Once the data is in Excel, there is all sorts of formatting that I perform in order to make it more presentable for the viewer. My goal is to create a macro that will perform
    all of the formatting. The script I have included below is achieving most of it, but I get an error message near the end of the script where it reads

    ActiveSheet.Paste (not the 1st one from the bottom, but the 2nd one)

    Please Login or Register  to view this content.
    Last edited by arlu1201; 05-07-2013 at 12:42 PM. Reason: Changed HTML tags to code tags.

  5. #5
    Valued Forum Contributor tehneXus's Avatar
    Join Date
    04-12-2013
    Location
    Hamburg, Germany
    MS-Off Ver
    Work: MS-Office 2010 32bit @ Win8 32bit / Home: MS-Office 2016 32bit @ Win10 64bit
    Posts
    944

    Re: Run-time error 1004 paste method of worksheet class failed

    try this, I had to remove some pasting into A1, O1 because it wasn't clear what should be pasted:
    Please Login or Register  to view this content.
    Please use [CODE]-TAGS
    When your problem is solved mark the thread SOLVED
    If an answer has helped you please click to give reputation
    Read the FORUM RULES

  6. #6
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,528

    Re: Run-time error 1004 paste method of worksheet class failed

    And this
    Please Login or Register  to view this content.
    can be replaced by this
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    05-01-2013
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    21

    Re: Run-time error 1004 paste method of worksheet class failed

    TehneXus,

    That worked perfectly. Thank you so much!


    Quote Originally Posted by tehneXus View Post
    try this, I had to remove some pasting into A1, O1 because it wasn't clear what should be pasted:
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    08-12-2013
    Location
    Piraeus, Greece
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Run-time error 1004 paste method of worksheet class failed

    Hi all,

    I am having the same problem. My paste method fails. I run my code in MS Excel 2010 and it fails
    while the same time if I run it on MS Excel 2003 it works perfectly. Can anyone help? Here is my code:


    Thanks in advance

    Please Login or Register  to view this content.

  9. #9
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,528

    Re: Run-time error 1004 paste method of worksheet class failed

    hatzisn
    Please read the forum rules. In this case, #2 is of interest to you.

    http://www.excelforum.com/forum-rule...rum-rules.html

  10. #10
    Registered User
    Join Date
    08-12-2013
    Location
    Piraeus, Greece
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Run-time error 1004 paste method of worksheet class failed

    Thank you jolivanes. I did not know that. I will keep that in mind.

+ 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