VBA macro tip contributed by
Erlandsen
Data Consulting offering Microsoft Excel Application development,
template customization, support and training solutions
If you just want to close a workbook without the user being prompted for any confirmations
about saving the workbook you can simply do this :
ActiveWorkbook.Close False
' closes the active workbook without saving any changes
ActiveWorkbook.Close True
' closes the active workbook and saves any changes
ActiveWorkbook.Close
' closes the active workbook and lets the user decide if
' changes are to be saved or not
Clipboard Nuissance
Huade wrote on December 31, 1969 19:00 EST
When I auto close out of a workbook with a lot of information stored on the clipboard, even when I use the do not save changes option, excel prompts me to save the data on the clipboard. Is there a way to clear the clipboard through VBA before closing a workbook?
Re: Clipboard Nuisance
Charvak Karpe wrote on December 31, 1969 19:00 EST
I also had this problem. Try
Application.CutCopyMode = False
to clear the clipboard.
You could also just copy a single cell to avoid the problem, but clearing it makes the most sense.
Terms
and Conditions of use
The applications/code on this site are distributed as is and without warranties
or liability. In no event shall the owner of the copyrights, or the authors
of the applications/code be liable for any loss of profit, any problems
or any damage resulting from the use or evaluation of the applications/code.