Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
XP XP is offline
external usenet poster
 
Posts: 389
Default Determine if clipboard is empty

Using Office 2003 and Windows XP;

Is it possible using VBA to determine if there are any contents in the
clipboard?

If so, could someone please post a generic example of how to do this?

Thanks much in advance.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 256
Default Determine if clipboard is empty

For text data, try this:

Public Declare Function OpenClipboard Lib "user32" (ByVal hwnd As
Long) As Long
Public Declare Function CloseClipboard Lib "user32" () As Long
Public Declare Function GetClipboardData Lib "user32" (ByVal uFormat
As Long) As Long

Public Function isClipboardEmpty() As Boolean
OpenClipboard (0&)
isClipboardEmpty = (GetClipboardData(1) = 0)
CloseClipboard
End Function



On Nov 28, 1:28 pm, XP wrote:
Using Office 2003 and Windows XP;

Is it possible using VBA to determine if there are any contents in the
clipboard?

If so, could someone please post a generic example of how to do this?

Thanks much in advance.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 947
Default Determine if clipboard is empty

Just another option to test if the Clipboard is only holding an address
reference

Function LinkingModeQ() As Boolean
With Application
LinkingModeQ = .CutCopyMode = xlCopy Or .CutCopyMode = xlCut
End With
End Function

Sub Demo()
Range("A1").Copy
MsgBox LinkingModeQ

'// Windows: Linking mode compromised, therefore turned off
Application.CutCopyMode = False
MsgBox LinkingModeQ
End Sub

--
HTH
Dana DeLouis


"XP" wrote in message
...
Using Office 2003 and Windows XP;

Is it possible using VBA to determine if there are any contents in the
clipboard?

If so, could someone please post a generic example of how to do this?

Thanks much in advance.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Clipboard empty but still get waring that clipboard is full Steve Excel Discussion (Misc queries) 0 June 17th 08 09:05 PM
Clipboard empty but get cannot empty CB when trying to copy Peter @ ServiceMaster Excel Worksheet Functions 0 February 22nd 07 03:58 PM
Cannot empty the Clipboard OhWellJon Excel Discussion (Misc queries) 0 September 19th 06 07:19 PM
Cannot empty the clipboard cjones Excel Discussion (Misc queries) 0 August 9th 06 11:10 PM
"Cannot empty Clipboard" tiff Excel Worksheet Functions 0 October 10th 05 10:18 PM


All times are GMT +1. The time now is 11:46 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"