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

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest

Danerida

Board Regular
Joined
Aug 25, 2014
Messages
152
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.
 

biocentrism

Board Regular
Joined
Jul 28, 2014
Messages
187
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?
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,559
Messages
5,832,482
Members
430,136
Latest member
Asir Jefferson

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
Top