Clipboard data at closure of a workbook

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
 
S

Steve Garman

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
 
R

Ron de Bruin

After your paste line in your code use this line to clear the clipboard

Application.CutCopyMode = False
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top