+ Reply to Thread
Results 1 to 4 of 4

Getting Run-Time error '1004': Paste method of Worksheet class failed

  1. #1
    Registered User
    Join Date
    10-03-2013
    Location
    Jacksonville, USA
    MS-Off Ver
    Excel 2010
    Posts
    25

    Question Getting Run-Time error '1004': Paste method of Worksheet class failed

    Hello guys,

    So I made this macro which automatically formats data output from our instrument to a form that can be listed. Copies the data and pastes it automatically along with the filename right next to it. It goes through the entire folder and opens up each file and repeats the process.

    The problem is that after the first few files I get the "Run-Time error '1004': Paste method of Worksheet class failed" error. The line of code that is in question after debugging is highlighted below.

    This is not the case of me copying entire rows nor is it the case of me copying 2,516 or more rows, so I do not see why this is occurring.

    Please Login or Register  to view this content.
    Any help that you can provide would be most appreciated.

  2. #2
    Forum Contributor
    Join Date
    03-21-2013
    Location
    Corvallis, OR
    MS-Off Ver
    Excel 2010
    Posts
    174

    Re: Getting Run-Time error '1004': Paste method of Worksheet class failed

    Can you specify the line of code that is causing the error separately? (It doesn't show up as highlighted for me.)

  3. #3
    Registered User
    Join Date
    10-03-2013
    Location
    Jacksonville, USA
    MS-Off Ver
    Excel 2010
    Posts
    25

    Re: Getting Run-Time error '1004': Paste method of Worksheet class failed

    Quote Originally Posted by bmxfreedom View Post
    Can you specify the line of code that is causing the error separately? (It doesn't show up as highlighted for me.)
    Here you go!
    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    03-21-2013
    Location
    Corvallis, OR
    MS-Off Ver
    Excel 2010
    Posts
    174

    Re: Getting Run-Time error '1004': Paste method of Worksheet class failed

    I'm having a hard time understanding what your code is trying to accomplish, but I would get rid of the ActiveWorkbook.Close before this paste because closing the workbook causes the copied data to go away. I would recommend naming the workbook with something like wbclose = activeworkbook.name, then using workbooks(wbclose).close after the paste, which would need to be done more specifically than just worksheets("SS"), but something along the lines of ThisWorkbook.Worksheets("SS") so that the code knows where those sheets are located.

+ 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] Run-time error 1004 paste method of worksheet class failed
    By Castillb in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-12-2013, 02:24 PM
  2. Excel Macro Error - Run time error 1004 - Paste method of worksheet class failed
    By kvflynn in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-15-2012, 10:51 AM
  3. Help with a Macro-Paste method of worksheet class failed run time error 1004
    By mcneill_garr in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-10-2011, 03:10 PM
  4. Run-time error '1004': Paste method of Worksheet class failed
    By shafto in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-05-2009, 07:49 PM
  5. Error 1004 Paste method of Worksheet class failed
    By skvabbili in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-04-2006, 06:10 PM

Tags for this Thread

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