» 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:
- Final Accounting: Ambition, Greed and the Fall of Arthur Andersen
- Microsoft Office XP Introductory Concepts and Techniques
- The 22 Immutable Laws of Marketing : Exposed and Explained by the World's Two
- Absolute Beginner's Guide to Microsoft Excel 2002
- Quantitative Methods in Derivatives Pricing: An Introduction to Computational Finance
- Flipping Properties: Generate Instant Cash Profits in Real Estate
RE: What if..
Ole P. Erlandsen Posted on: 31-12-1969
This might help you:
If ActiveWorkbook Is Nothing Then Exit Sub
' exits the procedure if no workbook is active
thanks
nedolph Posted on: 31-12-1969
Worked Perfectly
Worked like a charm!
James Posted on: 31-12-1969
Thank you!


thanks!