VBA to delete clipboard contents and proceed with VBA

adamlscott

New Member
Joined
Jun 7, 2007
Messages
17
This should be a simple one but I can't figure it out.

I have some very basic code that does the following:

(Workbook "X" is already open)

Open Workbook "A"
Copy Range
Activate Workbook "X"
Paste Range from "A"
Close WorkBook "A"

Open Workbook "B"
Copy Range
Activate Workbook "X"
Paste Range from "B"
Close WorkBook "B"

It does this for quite a few workbooks and saves me a good amount of time.

My problem is that as the workbooks close a dialog box appears alerting me that there is alot of info on the clipboard and whether I want to save it or delete it. I just want to delete it but I'd like to make that decision via code rather then wait for the dialog box to open. I'd like to insert a line of code after the close workbook line that will tell excel that I don't want to save the contents of the clipboard.

Any suggestions?
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Thanks Datsmart for the link. It didn't answer my question but it did lead me to a link that did.

All I have to do is have a line before closing the workbook that states:

Application.CutCopyMode = False

Thanks again for the link.
 
Upvote 0

Forum statistics

Threads
1,215,066
Messages
6,122,948
Members
449,095
Latest member
nmaske

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