My application is using the clipboard to transport grpahics from one application to another. Ideally I want to reduce the memory usage by deleting pictures from the clipboard after the job is done, but so far are my apporaches not very succesful.
I have tried two things so far, but when looking at the office clipboard in Excel (in the Edit menu). The clipboard remains full.
Here is what I have done so far
1) recorded a macro and deleted clipboard manually
Sub Macro1()
'
' Macro1 Macro
'
Application.CutCopyMode = False
End Sub
This does not work.
The other idea was to copy an empty string and paste it into the clipboard.
Sub ClearClipboard()
Dim DatObj As DataObject
Dim error_string As String
On Error GoTo errorhandler
Set DatObj = New DataObject
DatObj.SetText ""
DatObj.PutInClipboard
Exit Sub
errorhandler:
error_string = err.number & " " & err.Description
Application.Run "P_ErrorHandler", 4, error_string
End Sub
That does not empty the clipboard.
Any suggestions how to empty the clipboard more efficiently.
I have tried two things so far, but when looking at the office clipboard in Excel (in the Edit menu). The clipboard remains full.
Here is what I have done so far
1) recorded a macro and deleted clipboard manually
Sub Macro1()
'
' Macro1 Macro
'
Application.CutCopyMode = False
End Sub
This does not work.
The other idea was to copy an empty string and paste it into the clipboard.
Sub ClearClipboard()
Dim DatObj As DataObject
Dim error_string As String
On Error GoTo errorhandler
Set DatObj = New DataObject
DatObj.SetText ""
DatObj.PutInClipboard
Exit Sub
errorhandler:
error_string = err.number & " " & err.Description
Application.Run "P_ErrorHandler", 4, error_string
End Sub
That does not empty the clipboard.
Any suggestions how to empty the clipboard more efficiently.