» 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:
- The Basics of Finance: Financial Tools for Non Financial Managers
- Financial Peace: Revisited
- The Intelligent Investor: The Definitive Book On Value Investing, Revised Edition
- The Ernst & Young Business Plan Guide
- Microsoft Windows XP Inside Out
- The Total Money Makeover. : A Proven Plan for Financial Fitness
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.

