大家好!用VBA怎样写关闭已打开EXCEL文件(一次性要关闭多个),并保存的代码。谢谢大家了!!

2024-10-31 20:35:36
推荐回答(1个)
回答1:

Sub fasdf()
Dim wb As Object
For Each wb In Workbooks
If wb.Name <> ThisWorkbook.Name Then
wb.Close True
End If
Next
ThisWorkbook.Close True
End Sub