Sub 他のエクセルファイルを全部閉じる() For Each エクセル In Workbooks If エクセル.Name <> ThisWorkbook.Name Then エクセル.Close SaveChanges:=False End If Next エクセル End Sub