LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Check if clipboard is empty before .PasteSpecial xlPasteValues

I use the sub auto_open() to prevent format to be copied in a copy paste.
With Application
.OnKey "^v", "ValueOnly"
End With

and then this function:
Function ValueOnly()
Selection.PasteSpecial xlPasteValues
End Function

However, the code failes when trying to paste when no cells are highlighted
(you know, after control-C for example). Probably the clipboad is empty which
causes the error. How do I check if the clipboard is empty so I can prevent
the error from happening? Or should I use On Error code to catch such an
event?

Furthermore, is there a way to capture the paste event when used through the
rightclick-menu, edit-menu and button?
(Excel97)
 
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 tomcat3 Excel Discussion (Misc queries) 13 July 7th 06 09:11 PM
ActiveCell.PasteSpecial (xlPasteValues) hangs program hals_left Excel Programming 3 June 9th 04 11:18 AM
Why is my clipboard empty? Ed[_9_] Excel Programming 3 November 6th 03 11:08 PM


All times are GMT +1. The time now is 11:11 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"