Close workbook/clipboard thru macro

Firefly

New Member
Joined
Mar 27, 2002
Messages
16
I'm writing macros to generate reports from a database. I'm closing a workbook via macro after I've copied a quantity of data into another. I've been able to close the workbook automatically, but I still get the message about data on the clipboard & have to manually click save or delete. Anyway to automate that as well?
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
I think this works, use DisplayAlerts like this.

<pre>

Application.DisplayAlerts = False

'Your code for closing etc</pre>

HTH
 
Upvote 0
Mark, I seem to remember that this isn't affected by DisplayAlerts. You can, however do this before closing:

Application.CutCopyMode = False

or

Range("A1").Copy

Basically, reduce the Clipboard size so Excel won't pop up the message.
 
Upvote 0

Forum statistics

Threads
1,214,427
Messages
6,119,419
Members
448,895
Latest member
omarahmed1

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