On Error Resume Next SendKeys "{ESC}" Dim wb As Workbook Set wb = Workbooks.Open(fileName:=target_path, Password:="Password") If ActiveWorkbook.Name = FileName Then Debug.Print "開きました。" End If On Error GoTo 0 Set wb = Nothing
On Error Resume Next SendKeys "{ESC}" Dim wb As Workbook Set wb = Workbooks.Open(fileName:=target_path, Password:="Password") If ActiveWorkbook.Name = FileName Then Debug.Print "開きました。" End If On Error GoTo 0 Set wb = Nothing