ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   clipboard in excel (https://www.excelbanter.com/excel-programming/391795-clipboard-excel.html)

keri

clipboard in excel
 
I have a large piece of code involving copying and pasting LOTS of
data. I have application.cutcopymode = false after each paste line in
my code. However I am viewing the clipboard in excel ina task pane and
can see at the end of the code has 24 items in it.

Is there another way to clear these items so I do not end up with huge
amounts on the clipboard?


RB Smissaert

clipboard in excel
 
Try this:

Option Explicit
Private Declare Function OpenClipboard Lib "user32" (ByVal hwnd As Long) As
Long
Private Declare Function CloseClipboard Lib "user32" () As Long
Private Declare Function EmptyClipboard Lib "user32" () As Long

Sub ClearClipboard()
If OpenClipboard(0&) < 0 Then
EmptyClipboard
CloseClipboard
End If
End Sub

Then when you want to clear the clipboard just do ClearClipboard


RBS


"keri" wrote in message
oups.com...
I have a large piece of code involving copying and pasting LOTS of
data. I have application.cutcopymode = false after each paste line in
my code. However I am viewing the clipboard in excel ina task pane and
can see at the end of the code has 24 items in it.

Is there another way to clear these items so I do not end up with huge
amounts on the clipboard?




All times are GMT +1. The time now is 05:34 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com