Hi, Luke,
maybe try this change which will count the number of workbooks in the instance:
Private Sub Workbook_Open()
If Workbooks.Count > 1 Then
MsgBox ("PLEASE CLOSE ALL OTHER EXCEL FILES FIRST.")
ThisWorkbook.Close
End If
End Sub
Maybe you should alter the code to open the second workbook from this procedure.
Private Sub Workbook_Open()
Dim FileToOpen As Variant
If Workbooks.Count > 1 Then
MsgBox ("PLEASE CLOSE ALL OTHER EXCEL FILES FIRST.")
ThisWorkbook.Close
Else
FileToOpen = Application.GetOpenFilename("Excel Files (*.xls*), *.xls*")
If FileToOpen <> False Then
Workbooks.Open FileToOpen
End If
End If
End Sub
Ciao,
Holger
Bookmarks