Is there a way to clear the contents of the clipboard programatically?
Is there a way to clear the contents of the clipboard programatically?
Hi,
Does this code work
VBA Noov![]()
application.cutcopymode=false
_________________________________________
![]()
![]()
Credo Elvem ipsum etian vivere
_________________________________________
A message for cross posters
Please remember to wrap code.
Forum Rules
Please add to your signature if you found this link helpful. Excel links !!!
Hi VBA Noob
The CutCopyMode=False just removes the "marching ants". As the clipboard is a Windows object you need API's to clear it effectively.
Calling the macro ClearClipboard should do just that.![]()
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
HTH
DominicB
Please familiarise yourself with the rules before posting. You can find them here.
Thanks DominicB for the correction
VBA Noob
Thank you as well Dominicb
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks