Clearing the clipboard

S

ste mac

Hi Avi, this is what I use, its one of Chips...works fine

ste

Public Sub ClearClipboard()
Dim MyDataObj As New DataObject
MyDataObj.SetText ""
MyDataObj.PutInClipboard
End Sub
 
C

Chip Pearson

Application.CutCopyMode=False

This doesn't clear all the data in the clipboard, only Excel
data. Text will remain. To fully clear the clipboard, use

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

--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 

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