任意のブックが開いているか  次の文書

Dim wb As Workbook, flag As Boolean

Sub 任意のブック()
For Each wb In Workbooks
If wb.Name = "Book1.xls" Then flag = True
Next wb
If flag = True Then
MsgBox "Book1.xls を開いています。", vbInformation
Else
MsgBox "Book1.xls は開いていません。", vbInformation
End If
End Sub

 



← 左の文字をここへ入力後 登録ボタンをクリックしてください

(サイト管理者承認後掲載されます)