-
How to close the all excel workbooks once i open a one excel workbook
Hello Everyone
I have prepared one tool in my office , that tool is very much useful and i got good appreciation as well , now i have one issue with that, i have stuck with that problem, i.e.,if i open that excel , i can work with other excel workbooks , so am planning write workbook open event procedure code in such a way that , once i open a tool other excel workbooks has save and close , if excel workbooks which has not saved has save in default path of desktop ..can u guys help with this
-
This is a code i thought , can u guys help me to enhance it , how to save and close a workbooks in default path.
Sub closewbook()
Rem to close all workbooks except this w.book(tool)
Dim singlewbook As Workbook
For Each singlewbook In Workbooks
If singlewbook.Name <> ThisWorkbook.Name Then
singlewbook.Close True
End If
Next singlewbook
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules