Clear Excel Clipboard with VBA

B

Barb Reinhardt

I'm trying to clear the Excel clipboard with VBA. I've tried this

Application.CutCopyMode = False

And it doesn't clear it. What am I doing wrong?

Thanks,
Barb Reinhardt
 
K

Kenneth Hobson

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 ClearClipboard()
OpenClipboard 0&
EmptyClipboard
CloseClipboard
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top