Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Clearing Clipboard In Excel

Status
Not open for further replies.

Kevsim

Instructor
Joined
Apr 18, 2000
Messages
385
Location
AU
I found this code in one of the threads to clear the clipboard while in Excel.

Sub ClearTheClipboard()
Dim MyData As Object
Set MyData = New DataObject
MyData.SetText ""
On Error Resume Next
MyData.PutInClipboard
Set MyData = Nothing
End Sub

At "set MyData" I receive an error message "User defined type not defined"

I would appreciate some assistance with this issue.
kevsim
 
It may be that the required Library is not referenced in VB Editor Tools/References.

Seems a bit longwinded to me. Why not just copy an empty cell to clear existing clipboard data ? eg.Range("A65536").Copy


Regards
BrianB
Use CupOfCoffee to speed up all windows applications
================================
 
BrainB,
Thanks for the info, yes it works great, just shows how sometimes we go for the complicated.
kevsim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top