Window.Close(Object, Object, Object) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Closes the object.
public bool Close (object SaveChanges, object Filename, object RouteWorkbook);
Public Function Close (Optional SaveChanges As Object, Optional Filename As Object, Optional RouteWorkbook As Object) As Boolean
Parameters
- SaveChanges
- Object
Optional Object. If there are no changes to the workbook, this argument is ignored. If there are changes to the workbook and the workbook appears in other open windows, this argument is ignored. If there are changes to the workbook but the workbook doesn't appear in any other open windows, this argument specifies whether changes should be saved, as shown in the following table.ValueActionTrueSaves the changes to the workbook. If there is not yet a file name associated with the workbook, then FileName
is used. If FileName
is omitted, the user is asked to supply a file name.FalseDoes not save the changes to this file.OmittedDisplays a dialog box asking the user whether or not to save changes.
- Filename
- Object
Optional Object. Save changes under this file name.
- RouteWorkbook
- Object
Optional Object. If the workbook doesn't need to be routed to the next recipient (if it has no routing slip or has already been routed), this argument is ignored. Otherwise, Microsoft Excel routes the workbook as shown in the following table.ValueMeaningTrueSends the workbook to the next recipient.FalseDoesn't send the workbook.OmittedDisplays a dialog box asking the user whether the workbook should be sent.
Returns
Remarks
The Close method doesn't run any Auto_Close macros in the workbook. Use the RunAutoMacros(XlRunAutoMacro) method to run the auto close macros.