'偵測以下活頁簿是否開啟
bookname = "101-11日報表.xlsm"
For Each wbs In Workbooks
If UCase(wbs.Name) = UCase(bookname) Then
MsgBox bookname & " 已開啟,將自動儲存關閉"
Workbooks("101-11日報表.xlsm").Activate '切換活頁簿
ActiveWorkbook.Save '儲存目前使用的活頁簿
ActiveWorkbook.Close '關閉活頁簿
Exit For
End If
Next wbs
end sub作者: GBKEE 時間: 2012-11-18 14:48