Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Throw Exception if Clipboard is Empty
I have a simple paste action in VBA:
Range("Q2").Select ActiveSheet.Paste I'd like to catch and throw an exception if the user's clipboard is empty. Currently, the user gets the "End - Debug" general exception. I appreciate any help! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Throw Exception if Clipboard is Empty
Hi
You need to use the error handler: On Error Resume Next Range("Q2").Select ActiveSheet.Paste If Err.Number = 1004 Then msg = MsgBox(Err.Description) End If Err.Clear Regards, Per "PumaMan" skrev i meddelelsen ... I have a simple paste action in VBA: Range("Q2").Select ActiveSheet.Paste I'd like to catch and throw an exception if the user's clipboard is empty. Currently, the user gets the "End - Debug" general exception. I appreciate any help! |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Throw Exception if Clipboard is Empty
Range("Q2").Select
Selection.PasteSpecial xlPasteValues or Range("q2").PasteSpecial xlPasteAll On Oct 19, 6:46*pm, PumaMan wrote: I have a simple paste action in VBA: * * Range("Q2").Select * * ActiveSheet.Paste I'd like to catch and throw an exception if the user's clipboard is empty.. * Currently, the user gets the "End - Debug" general exception. I appreciate any help! |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Throw Exception if Clipboard is Empty
On Oct 19, 7:46*am, PumaMan wrote:
I have a simple paste action in VBA: * * Range("Q2").Select * * ActiveSheet.Paste I'd like to catch and throw an exception if the user's clipboard is empty.. * Currently, the user gets the "End - Debug" general exception. I appreciate any help! How about something like... If Application.ClipboardFormats(1) = -1 Then MsgBox "Clipboard Empty!" End If ....Ron |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Clipboard empty but still get waring that clipboard is full | Excel Discussion (Misc queries) | |||
Clipboard empty but get cannot empty CB when trying to copy | Excel Worksheet Functions | |||
Cannot empty the Clipboard | Excel Discussion (Misc queries) | |||
Cannot empty the clipboard | Excel Discussion (Misc queries) | |||
Why is my clipboard empty? | Excel Programming |