PasteSpecial error handling
You could check the status of the paste button on the Edit Commandbar.
You could just do
On Error Resume Next
Range("A1").Pastespecial
On Error goto 0
this will suppress the error if it occurs.
--
Regards,
Tom Ogilvy
"JakeyC" wrote in message
oups.com...
I am currently in the middle of developing a macro which as part of the
routine will use something like Range("A1").PasteSpecial to paste
whatever is currently on the clipboard.
However, there is not necessarily anything waiting to be pasted and, if
this was the case, the above statement would generate a runtime error.
Can anyone suggest a way to
1) Detect whether or not there is data on the clipboard, and skip the
routine if so
or
2) If the macro tries to paste something that's not there, it handles
the error and continues to function.
Thanks in advance.
|