Share via


Workbooks.Close Method (Excel)

Closes the object.

Syntax

.Close

A variable that represents a Workbooks object.

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.

Example

This example closes all open workbooks. If there are changes in any open workbook, Microsoft Excel displays the appropriate prompts and dialog boxes for saving changes.

Workbooks.Close

참고 항목

개념

Workbooks Object

Workbooks Object Members