Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
In an Excel 2003 macro, how do I check for a blank (empty) clipboard?
|
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
If you want to test whether the user is in the process of a copy or
cut operation within Excel, you can use Select Case Application.CutCopyMode Case xlCopy Debug.Print "Copy in progress" Case xlCut Debug.Print "Cut in progress" Case Else Debug.Print "No copy/cut in progress" End Select This returns that status of Excel's clipboard, returning true if there is a copy or cut pending (the range has the marching ants border). You can cancel the copy/cut mode with Application.CutCopyMode = False If you really need to see if *anything* (including non-Excel related stuff) is in the clipboard, use Public Declare Function CountClipboardFormats Lib "user32" () As Long Sub AAA() Dim N As Long N = CountClipboardFormats() If N = 0 Then Debug.Print "nothing on clipboard" Else Debug.Print "something on clipboard" End If End Sub If you want to totally clear the clipboard, use Public Declare Function OpenClipboard Lib "user32" (ByVal hwnd As Long) As Long Public Declare Function CloseClipboard Lib "user32" () As Long Public Declare Function EmptyClipboard Lib "user32" () As Long Sub ClearClipboard() OpenClipboard 0& EmptyClipboard CloseClipboard End Sub Cordially, Chip Pearson Microsoft Most Valuable Professional Excel Product Group, 1998 - 2009 Pearson Software Consulting, LLC www.cpearson.com (email on web site) On Thu, 12 Feb 2009 08:36:18 -0800, Mr. Clean wrote: In an Excel 2003 macro, how do I check for a blank (empty) clipboard? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to check for blank cells with formula | Excel Discussion (Misc queries) | |||
Using Vlookup and IF statements to check for blank cells | Excel Worksheet Functions | |||
Clipboard empty but still get waring that clipboard is full | Excel Discussion (Misc queries) | |||
check a row ignore blank cells print only those with text | Excel Discussion (Misc queries) | |||
check for two blank cells before populating a 3rd. | Excel Worksheet Functions |