+ Reply to Thread
Results 1 to 5 of 5

clearing the clipboard

Hybrid View

  1. #1
    Registered User
    Join Date
    10-26-2012
    Location
    Budapest, Hungary
    MS-Off Ver
    Excel 2010
    Posts
    5

    clearing the clipboard

    Hi All,

    I found this method in this forum but it doesn't work for me. What have I missed? What should I do to make it work?

    Declare Function CloseClipboard Lib "user32" () As Long
    Declare Function EmptyClipboard Lib "user32" () As Long
    Declare Function OpenClipboard Lib "user32" (ByVal hwnd As Long) As Long
    
    Sub AAA()
    OpenClipboard 0&
    EmptyClipboard
    CloseClipboard
    End Sub
    Regards,
    Stefi
    Last edited by jeffreybrown; 10-26-2012 at 07:14 PM. Reason: Please use code tags...Thanks.

  2. #2
    Valued Forum Contributor
    Join Date
    03-17-2012
    Location
    Warsaw, Poland
    MS-Off Ver
    2007/2010
    Posts
    555

    Re: clearing the clipboard

    please use this instead

    Sub test()
    
    Application.CutCopyMode = False
    
    End Sub
    If you think that my answer was helpful, please click on the "Add to this user's Reputation" button.

  3. #3
    Registered User
    Join Date
    10-26-2012
    Location
    Budapest, Hungary
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: clearing the clipboard

    Thank you for your answer, I saw this solution in many forums and many threads, but it doesn't work for me as well. It simply stops displaying "marching ants" around the range being copied. I don't understand why so many people think it clears the clipboard. Maybe I miss somthing?

    Regards,
    Stefi

  4. #4
    Valued Forum Contributor
    Join Date
    02-12-2011
    Location
    The Netherlands
    MS-Off Ver
    365
    Posts
    860

    Re: clearing the clipboard

    Why would you clear the clipboard?
    Are you getting a message?
    To overcome a message:
    application.displayalerts=false
    Harry.

  5. #5
    Registered User
    Join Date
    10-26-2012
    Location
    Budapest, Hungary
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: clearing the clipboard

    Well, I'm copying text and charts from Excel into Word with Copy/Paste in an Excel macro, it worked well several times, and at the next item (nothing different) I got an error message saying Paste cannot be done because there is nothing in the clipboard. I can't imagine why Copy didn't filled up the clipboard, I just thought it is overloaded, maybe clearing it helps.
    Do you have any idea?
    Thanks,
    Stefi

+ 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