Jak wyczyścić schowek? Można np. skorzystać z Win32API. Poniższy kod jest zgodny zarówno z 32- jak i 64-bitową wersją pakietu Office.
#If VBA7 Then
Private Declare PtrSafe Function OpenClipboard Lib "user32" (ByVal hwnd As Long) As LongPtr
Private Declare PtrSafe Function EmptyClipboard Lib "user32" () As LongPtr
Private Declare PtrSafe Function CloseClipboard Lib "user32" () As LongPtr
#Else
Private Declare Function OpenClipboard Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function EmptyClipboard Lib "user32" () As Long
Private Declare Function CloseClipboard Lib "user32" () As Long
#End If
Sub CzyscSchowek()
Dim odp as Long
odp = MsgBox("Czy chcesz wyczyścić zawartość schowka? ", vbYesNo Or vbInformation)
If odp = vbNo Then Exit Sub
OpenClipboard (0&)
EmptyClipboard
CloseClipboard
End Sub