Clipboard data at closure of a workbook

  • Thread starter Thread starter bfsebo
  • Start date Start date
B

bfsebo

I copy lots of data from one workbook to another. When I
close the workbook from where the data is copied, I get a
(pop-up) warning window that there is a lot of data on the
clipboard with the question if it should be saved.
In macro's I want to close workbooks; NO QUESTIONS ASKED.
Does anyone know how to suspress this annoying question
from Excel during the execution of macro's
 
I copy lots of data from one workbook to another. When I
close the workbook from where the data is copied, I get a
(pop-up) warning window that there is a lot of data on the
clipboard with the question if it should be saved.
In macro's I want to close workbooks; NO QUESTIONS ASKED.
Does anyone know how to suspress this annoying question
from Excel during the execution of macro's

If you don't want to save it, use
ActiveWorkbook.Saved = True
(probably with a workbook object different from "ActiveWorkbook")
before saving

If you do want to save it, try:

Application.DisplayAlerts = False
before saving and
Application.DisplayAlerts = True
afterwards
 
After your paste line in your code use this line to clear the clipboard

Application.CutCopyMode = False
 
Back
Top