Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 471
Default xlPasteValues is Empty

How can I test that there is something to paste so that executing this line
of code does not return an error 1004. I am not capturing anything via VBA.
I am just wanting to paste what is in the clipboard. But if nothing is there
I get the error. Thanks!

Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 834
Default xlPasteValues is Empty

How about just error wrapping it

On Error Resume Next
Selection.PasteSpecial Paste:=xlPasteValues, _
Operation:=xlNone, _
SkipBlanks:=False, _
Transpose:=False
On Error Goto 0

HTH

Bob

"Mike H." wrote in message
...
How can I test that there is something to paste so that executing this
line
of code does not return an error 1004. I am not capturing anything via
VBA.
I am just wanting to paste what is in the clipboard. But if nothing is
there
I get the error. Thanks!

Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 471
Default xlPasteValues is Empty

Gosh, Bob. That was too simple! I will certainly solve it that way. I've
done that many times before but had a senior moment this time, I s'pose!
Thanks!

"Bob Phillips" wrote:

How about just error wrapping it

On Error Resume Next
Selection.PasteSpecial Paste:=xlPasteValues, _
Operation:=xlNone, _
SkipBlanks:=False, _
Transpose:=False
On Error Goto 0

HTH

Bob

"Mike H." wrote in message
...
How can I test that there is something to paste so that executing this
line
of code does not return an error 1004. I am not capturing anything via
VBA.
I am just wanting to paste what is in the clipboard. But if nothing is
there
I get the error. Thanks!

Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False



.

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
xlPasteValues Dale Excel Programming 2 March 12th 07 07:56 PM
How to set Paste:=xlPasteValues for all paste operations? [email protected] Excel Programming 2 September 7th 06 06:23 AM
Ron de Bruin - Using PasteSpecial (xlPasteValues) instead of Copy Bob Excel Programming 8 August 16th 06 07:56 PM
Check if clipboard is empty before .PasteSpecial xlPasteValues Spaan Excel Programming 2 August 23rd 04 03:13 PM
ActiveCell.PasteSpecial (xlPasteValues) hangs program hals_left Excel Programming 3 June 9th 04 11:18 AM


All times are GMT +1. The time now is 10:18 PM.

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"