Skip to content

Latest commit

 

History

History
46 lines (27 loc) · 1.98 KB

Excel.Window.Close.md

File metadata and controls

46 lines (27 loc) · 1.98 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
Window.Close method (Excel)
vbaxl10.chm356081
vbaxl10.chm356081
Excel.Window.Close
59772b1d-823e-70d6-97d7-a5ddb44abdcc
05/21/2019
medium

Window.Close method (Excel)

Closes the object.

Syntax

expression.Close (SaveChanges, FileName, RouteWorkbook)

expression A variable that represents a Window object.

Parameters

Name Required/Optional Data type Description
SaveChanges Optional Variant 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.If set to True, changes are saved to the workbook.

If there is not yet a file name associated with the workbook, FileName is used. If FileName is omitted, the user is asked to supply a file name.
FileName Optional Variant Save changes under this file name.
RouteWorkbook Optional Variant 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 according to the value of this parameter.

If set to True, the workbook is sent to the next recipient. If set to False, the workbook is not sent. If omitted, the user is asked whether the workbook should be sent.

Return value

True if the method successfully closed the object; otherwise, False.

Remarks

Closing a workbook from Visual Basic doesn't run any Auto_Close macros in the workbook. Use the RunAutoMacros method to run the Auto_Close macros.

[!includeSupport and feedback]