Properly Clearing Clipboard

biocentrism

Board Regular
Joined
Jul 28, 2014
Messages
177
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:

Some videos you may like

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)

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
177
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?
 

Watch MrExcel Video

Forum statistics

Threads
1,122,962
Messages
5,599,065
Members
414,281
Latest member
Engjamal2021

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