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

Hi All......
This works fine in XL2k if there is something on the Clipboard, but fails
with "Run time Error" if the clipboard is empty.......

CommandBars("clipboard").Controls("clear clipboard").Execute

How might I word an IF statement to check if the Clipboard is empty or not?

TIA
Vaya con Dios,
Chuck, CABGx3


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Test if clipboard empty

I bet you could look at one of the icons on that toolbar to see if it's enabled,
but I'd just weasel out and do:

On error resume next
'your command
on error goto 0



CLR wrote:

Hi All......
This works fine in XL2k if there is something on the Clipboard, but fails
with "Run time Error" if the clipboard is empty.......

CommandBars("clipboard").Controls("clear clipboard").Execute

How might I word an IF statement to check if the Clipboard is empty or not?

TIA
Vaya con Dios,
Chuck, CABGx3


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Test if clipboard empty

I thought that command bars are no longer used in 2007. Was I mistaken?

"Dave Peterson" wrote:

I bet you could look at one of the icons on that toolbar to see if it's enabled,
but I'd just weasel out and do:

On error resume next
'your command
on error goto 0



CLR wrote:

Hi All......
This works fine in XL2k if there is something on the Clipboard, but fails
with "Run time Error" if the clipboard is empty.......

CommandBars("clipboard").Controls("clear clipboard").Execute

How might I word an IF statement to check if the Clipboard is empty or not?

TIA
Vaya con Dios,
Chuck, CABGx3


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Test if clipboard empty

Indeed, in 2007 Commandbars have been replaced by the "Ribbon" as the UI,
although they do still exist to some extent. However since 2003 (possibly
2002 ?) the clipboard is shown in the "Task Pane".

For all versions I think simply the following should be enough

Application.CutCopyMode = False

Regards,
Peter T


"Barb Reinhardt" wrote in message
...
I thought that command bars are no longer used in 2007. Was I mistaken?

"Dave Peterson" wrote:

I bet you could look at one of the icons on that toolbar to see if it's
enabled,
but I'd just weasel out and do:

On error resume next
'your command
on error goto 0



CLR wrote:

Hi All......
This works fine in XL2k if there is something on the Clipboard, but
fails
with "Run time Error" if the clipboard is empty.......

CommandBars("clipboard").Controls("clear clipboard").Execute

How might I word an IF statement to check if the Clipboard is empty or
not?

TIA
Vaya con Dios,
Chuck, CABGx3


--

Dave Peterson



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Test if clipboard empty

I've seen people that complain that it doesn't always work (but I don't use the
office clipboard).

Maybe the routine at Chip Pearson's site will work:
http://www.cpearson.com/excel/Clipboard.aspx
look for: EmptyClipboard

Peter T wrote:

Indeed, in 2007 Commandbars have been replaced by the "Ribbon" as the UI,
although they do still exist to some extent. However since 2003 (possibly
2002 ?) the clipboard is shown in the "Task Pane".

For all versions I think simply the following should be enough

Application.CutCopyMode = False

Regards,
Peter T

"Barb Reinhardt" wrote in message
...
I thought that command bars are no longer used in 2007. Was I mistaken?

"Dave Peterson" wrote:

I bet you could look at one of the icons on that toolbar to see if it's
enabled,
but I'd just weasel out and do:

On error resume next
'your command
on error goto 0



CLR wrote:

Hi All......
This works fine in XL2k if there is something on the Clipboard, but
fails
with "Run time Error" if the clipboard is empty.......

CommandBars("clipboard").Controls("clear clipboard").Execute

How might I word an IF statement to check if the Clipboard is empty or
not?

TIA
Vaya con Dios,
Chuck, CABGx3

--

Dave Peterson


--

Dave Peterson


  #6   Report Post  
Posted to microsoft.public.excel.programming
CLR CLR is offline
external usenet poster
 
Posts: 594
Default Test if clipboard empty

Many thanks Dave........your suggestion does the job just fine!

Vaya con Dios,
Chuck, CABGx3


"Dave Peterson" wrote in message
...
I bet you could look at one of the icons on that toolbar to see if it's
enabled,
but I'd just weasel out and do:

On error resume next
'your command
on error goto 0



CLR wrote:

Hi All......
This works fine in XL2k if there is something on the Clipboard, but fails
with "Run time Error" if the clipboard is empty.......

CommandBars("clipboard").Controls("clear clipboard").Execute

How might I word an IF statement to check if the Clipboard is empty or
not?

TIA
Vaya con Dios,
Chuck, CABGx3


--

Dave Peterson



  #7   Report Post  
Posted to microsoft.public.excel.programming
CLR CLR is offline
external usenet poster
 
Posts: 594
Default Test if clipboard empty

I've heard that too Barb, but in this case I'm using XL2000, so Dave's
suggestion worked for me.

Vaya con Dios,
Chuck, CABGx3


"Barb Reinhardt" wrote in message
...
I thought that command bars are no longer used in 2007. Was I mistaken?

"Dave Peterson" wrote:

I bet you could look at one of the icons on that toolbar to see if it's
enabled,
but I'd just weasel out and do:

On error resume next
'your command
on error goto 0



CLR wrote:

Hi All......
This works fine in XL2k if there is something on the Clipboard, but
fails
with "Run time Error" if the clipboard is empty.......

CommandBars("clipboard").Controls("clear clipboard").Execute

How might I word an IF statement to check if the Clipboard is empty or
not?

TIA
Vaya con Dios,
Chuck, CABGx3


--

Dave Peterson



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
Cannot empty the clipboard Jaleel Excel Discussion (Misc queries) 1 November 22nd 09 08:57 PM
Clipboard empty but still get waring that clipboard is full Steve Excel Discussion (Misc queries) 0 June 17th 08 09:05 PM
Empty clipboard Jeff Excel Discussion (Misc queries) 2 May 30th 07 06:56 PM
Clipboard empty but get cannot empty CB when trying to copy Peter @ ServiceMaster Excel Worksheet Functions 0 February 22nd 07 03:58 PM
Test if Clipboard is empty Tod Excel Programming 1 August 17th 04 05:00 PM


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