Author Topic: Close a workbook using VBA in Microsoft Excel  (Read 4931 times)

bbasujon

  • Administrator
  • VIP Member
  • *****
  • Posts: 1826
  • I want to show my performance at any where
    • View Profile
    • Higher Education
Close a workbook using VBA in Microsoft Excel
« on: August 15, 2012, 05:38:45 PM »
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
Acquire the knowledge and share the knowledge so that knowing,learning then sharing - all are the collection