Properly Clearing Clipboard

biocentrism

Board Regular
Joined
Jul 28, 2014
Messages
187
Hello

I have a very, very large macro which does a lot of copying and pasting of ranges, creation of arrays from a database recordset and copy and pasting worksheets to the end of the workbook. The RAM usage can be in excess of 15GB. When I exit out of Excel, I get a prompt saying that there is a lot of data on the clipboard and do I want to save it.

I am surprised by this because I have at the end of the macro: Application.CutCopyMode = False.

My understanding is that this should clear the clipboard.

What am I doing wrong such that there is still data in the clipboard after the macro has run? How do I properly delete data from the clipboard?

Thank you.
 
Last edited:

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
You would be better served to avoid using the clipboard as much as possible. In most cases copy and paste can be replaced by copy-destination syntax which bypasses the clipboard. This will speed up your code and lower the usage of system resources.

Dan.
 
Upvote 0
You would be better served to avoid using the clipboard as much as possible. In most cases copy and paste can be replaced by copy-destination syntax which bypasses the clipboard. This will speed up your code and lower the usage of system resources.

Dan.

Yes I am aware of that. But my questions remains, in the event that I use the clipboard, how do I clear it?
 
Upvote 0

Forum statistics

Threads
1,213,561
Messages
6,114,315
Members
448,564
Latest member
ED38

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top