View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Leith Ross[_270_] Leith Ross[_270_] is offline
external usenet poster
 
Posts: 1
Default VBA Clear clipboard


Hello Nick,

Add a VBA module to your project and add this code to it.

CALLING THE MACRO:
ClearClipboard


Code:
--------------------

Declare Function OpenClipboard _
Lib "User32.dll" _
(ByVal hWndNewOwner As Long) As Long

Declare Function EmptyClipboard _
Lib "User32.dll" () As Long

Declare Function CloseClipboard _
Lib "User32.dll" () As Long

Public Sub ClearClipboard()

Dim Ret

Ret = OpenClipboard(0&)
If Ret < 0 Then Ret = EmptyClipboard
CloseClipboard

End Sub

--------------------

Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=484632