+ Reply to Thread
Results 1 to 3 of 3

Runtime 1004 - clipboard error

  1. #1
    Registered User
    Join Date
    01-07-2013
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    1

    Runtime 1004 - clipboard error

    I have a simple macro that carries out a number of of copy/paste special actions on the basis of a menu pick to update the information in a chart.

    The problem is that half the time when I call the macro there are no problems and the rest of the time I get the following error

    "runtime error 1004 pastespecial method of range class failed"


    When prompted to debug, the highlighted problem line could be any one of the 4 paste special lines in the code below.

    What I don't understand is why the error doesn't occur everytime? If there was a problem with the code I would expect it to always fail?

    This leads me to suspect that the problem is something to do with the clipboard and the way it is filled/emptied?

    I think a lot of people have this problem so any suggestions greatefully received.



    Please Login or Register  to view this content.

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Runtime 1004 - clipboard error

    For errors that seem to occur some times and not others its always worth trying sprinkling the code with the DoEvents statement which releases resources to other applications to do what they need to do before Excel continues.
    Martin

  3. #3
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Runtime 1004 - clipboard error

    you may also avoid the clipboard-replace
    Please Login or Register  to view this content.
    by
    Please Login or Register  to view this content.
    for instance
    Josie

    if at first you don't succeed try doing it the way your wife told you to

+ 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