Hi,
Perhaps something like the following Function and its calling procedure.
Sub IsWorkbookOpen()
If WorkbookIsOpen("your file name") Then 'change name to suit or read from variable
MsgBox ("File: " & "name" & " is already open"), vbInformation
Else
MsgBox ("File: " & "name" & " is not open"), vbInformation
End If
End Sub
Function WorkbookIsOpen(wbName) As Boolean
'Returns TRUE if the workbook is open
Dim x As Workbook
On Error Resume Next
Set x = Workbooks(wbName)
If Err = 0 Then WorkbookIsOpen = True Else: WorkbookIsOpen = False
End Function
Bookmarks