ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Clipboard data at closure of a workbook (https://www.excelbanter.com/excel-programming/283220-clipboard-data-closure-workbook.html)

[email protected]

Clipboard data at closure of a workbook
 
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

Steve Garman

Clipboard data at closure of a workbook
 
wrote:
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

--
Steve Garman


Ron de Bruin

Clipboard data at closure of a workbook
 
After your paste line in your code use this line to clear the clipboard

Application.CutCopyMode = False


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



" wrote in message ...
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





All times are GMT +1. The time now is 11:47 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com