Close

Home Search Site Map

Up
Close
Exit
File Search...
Most Frequently Used
New...
Open...
Page Setup...
Permission
Print...
Print Area
Print Preview
Properties
Save
Save As...
Save as Web Page...
Save Workspace...
Send To
Web Page Preview

New! Excel User Group Now Open @ www.excelusergroup.org, Check It Out!


Menu command Type What happens next?
Close  

Closes the 'active workbook'. That is the top one when you have multiple workbooks open. If the workbook has been altered in any way, other than simple scrolling or changing of selection, since the last save, you will be prompted to save the workbook.

If the workbook is new, accepting 'yes' in this dialog will present the 'save as...' dialog. I all other instances the workbook will be saved as the same file name in the same folder as the original, (over-written), without presenting another dialog. Selecting 'no' at this prompt will leave the original workbook in the same state as at the last save and 'cancel' will  cancel the 'close' operation, effectively doing nothing. Since Excel XP you will automatically be prompted to save a workbook created in an older version.

This ensures the workbook has all formulae updated using the new calculation engine.

VBA Sub wbClose()
Dim wb As Workbook
Set wb = ActiveWorkbook
'Do what you want with workbook here using wb variable
wb.Close SaveChanges:=True 'Saves changes
End Sub

Top

Copyright Nick Hodge 2008. All Rights Reserved.