Name

window.Close([SaveChanges], [Filename], [RouteWorkbook])

Synopsis

Close the window. Closing the last open window for a workbook closes the workbook, so Close has these arguments in the following table that determine what to do in that case:

Argument

Setting

SaveChanges

True saves changes to the workbook; False abandons changes. Prompts the user if omitted.

Filename

The name of the file to save the workbook as; default is the current filename.

RouteWorkbook

If the workbook has a routing slip attached, True routes the workbook to the next recipient; False does not route. Prompts the user if omitted.

Get Programming Excel with VBA and .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.