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

I have an XL 2013 workbook into which I paste data from an intranet webpage.
If a user forgets to copy the data before invoking the macro that pastes the data into the workbook and manipulates it, they get the Run-time error 1004.
When the user invokes the macro with the clipboard empty, I would like foe the macro to either end, or better yet, activate a message-box that tell the user what the problem is [empty clipboard], then exits the macro. How can I accomplish this?

Thanks,
Tonso
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,872
Default If clipboard is empty..

Hi Tonso,

Am Mon, 20 Jul 2015 04:19:39 -0700 (PDT) schrieb Tonso:

I have an XL 2013 workbook into which I paste data from an intranet webpage.
If a user forgets to copy the data before invoking the macro that pastes the data into the workbook and manipulates it, they get the Run-time error 1004.
When the user invokes the macro with the clipboard empty, I would like foe the macro to either end, or better yet, activate a message-box that tell the user what the problem is [empty clipboard], then exits the macro. How can I accomplish this?


try:

If Application.ClipboardFormats(1) = -1 Then
MsgBox "Clipboard is empty"
Exit Sub
End If


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 90
Default If clipboard is empty..

On Monday, July 20, 2015 at 7:19:53 AM UTC-4, Tonso wrote:
I have an XL 2013 workbook into which I paste data from an intranet webpage.
If a user forgets to copy the data before invoking the macro that pastes the data into the workbook and manipulates it, they get the Run-time error 1004.
When the user invokes the macro with the clipboard empty, I would like foe the macro to either end, or better yet, activate a message-box that tell the user what the problem is [empty clipboard], then exits the macro. How can I accomplish this?

Thanks,
Tonso


Claus,
Thanks! Works perfect!
Tonso
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 Poconodan Excel Discussion (Misc queries) 1 November 26th 08 06:09 PM
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 OhWellJon Excel Discussion (Misc queries) 0 September 19th 06 07:19 PM
Cannot empty the clipboard cjones Excel Discussion (Misc queries) 0 August 9th 06 11:10 PM


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