PC Review


Reply
Thread Tools Rate Thread

Clear Excel Clipboard with VBA

 
 
Barb Reinhardt
Guest
Posts: n/a
 
      10th Jun 2008
I'm trying to clear the Excel clipboard with VBA. I've tried this

Application.CutCopyMode = False

And it doesn't clear it. What am I doing wrong?

Thanks,
Barb Reinhardt

 
Reply With Quote
 
 
 
 
Gary''s Student
Guest
Posts: n/a
 
      10th Jun 2008
Public Sub ClearClipboard()
Dim MyDataObj As New DataObject
MyDataObj.SetText ""
MyDataObj.PutInClipboard
End Sub


From:

http://www.cpearson.com/excel/clipboard.htm
--
Gary''s Student - gsnu200791


"Barb Reinhardt" wrote:

> I'm trying to clear the Excel clipboard with VBA. I've tried this
>
> Application.CutCopyMode = False
>
> And it doesn't clear it. What am I doing wrong?
>
> Thanks,
> Barb Reinhardt
>

 
Reply With Quote
 
Kenneth Hobson
Guest
Posts: n/a
 
      10th Jun 2008
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
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Clear Clipboard command in Excel 2007 Rob Microsoft Excel Programming 1 19th May 2009 06:07 PM
Clear and control the Office clipboard in Excel =?Utf-8?B?cXVhcnR6?= Microsoft Excel Programming 0 22nd Feb 2005 08:33 PM
cannot clear clipboard when clipboard appears empty =?Utf-8?B?U2hhbmk=?= Microsoft Excel Misc 1 4th Nov 2004 02:58 AM
Pasting in Excel should NOT clear the clipboard! =?Utf-8?B?TWlsbmV5?= Microsoft Excel Misc 2 20th Oct 2004 06:50 PM
Clear Clipboard on Workbook Close Event (Excel XP) Culichi Microsoft Excel Programming 2 23rd Feb 2004 06:21 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:32 PM.