My Goal is to pop-up an message box "The file is opened to another workbook, please close it"
The problem is I am trying to detect if the filename sheet is opened to another workbook.
I tried to code it but I will only detect if the filename is open to the workbook that I used.
Public Sub MainDelete()    
    xRet = IsWorkBookOpen(currentName & ".xlsx")
    If t_int_fc.FolderExists(SuperFinalmyPath & "\検査資料(PH→DTJP)\塗りつぶし結果\PH塗り潰し結果\セルフ結果\Tool②_Output(Delete)\") = True Then
        If xRet Then
            Call Warnings(7)
            CheckOpen = True
        Else                      
            CheckOpen = False
        End If
    Else
       'Do nothing
    End If  
End Sub
Function IsWorkBookOpen(Name As String) As Boolean
    Dim xWb As Workbook
    On Error Resume Next
    Set xWb = Application.Workbooks.Item(Name)
    IsWorkBookOpen = (Not xWb Is Nothing)
End Function
Public Sub Warnings(Num As Integer)
    Select Case Num
        Case 1
            MsgBox "入力 Section is not existing"
        Case 2
            MsgBox "理論 Section is not existing"
        Case 3
            MsgBox "Incorrect Placement of 入力値 Section"
        Case 4
            MsgBox "Incorrect Placement of 理論値 Section"
        Case 5
            MsgBox "No Target(対象) Items"
        Case 6
            MsgBox "Inspection sheet must be located in 「検査結果」folder"
        Case 7
            MsgBox "Generated file is already open! Please close it first."
    End Select
End Sub