Finance

Charts

Statistics

Macros

Search

Closes all open workbooks in Excel VBA

Here is a procedure that closes all open workbooks:

Sub CloseAllWorkbooks()
    Workbooks.Close
End Sub

Explanation:
The Close() method is called on the Workbooks object. This closes all open workbooks but does not close the Visual Basic Editor (VBE) or Excel Help.
Excel itself remains open after running this procedure.
If a user has made changes to any workbook, they will be prompted to save those changes .

0 0 votes
Évaluation de l'article
S’abonner
Notification pour
guest
0 Commentaires
Le plus ancien
Le plus récent Le plus populaire
Online comments
Show all comments
Facebook
Twitter
LinkedIn
WhatsApp
Email
Print
0
We’d love to hear your thoughts — please leave a commentx