» Close a workbook using VBA in Microsoft Excel
VBA macro tip contributed by Erlandsen Data Consulting offering Microsoft Excel Application development, template customization, support and training solutions
CATEGORY - Files, Workbook, and Worksheets in VBA
VERSION - All Microsoft Excel Versions
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
Book Store:
Recommended Books:
- Millionaire Real Estate Mentor : The Secrets of Financial Freedom through Real Estate Investing
- The Guide to Understanding Financial Statements
- Harry Potter and the Order of the Phoenix (Book 5)
- Accounting and Financial Fundamentals for Nonfinancial Executives
- Microsoft Excel 2002 Formulas (With CD-ROM)
- Final Accounting: Ambition, Greed and the Fall of Arthur Andersen
Clipboard Nuissance
Huade
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
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.

