Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.OnWindow = ""
End Sub
Private Sub Workbook_Open()
Application.OnWindow = ThisWorkbook.Name & "!ThisWbkOnly"
End Sub
In a standard module:
Sub ThisWbkOnly()
If Not ActiveWorkbook.Name = ThisWorkbook.Name Then
ActiveWorkbook.Close False
MsgBox "This session of Excel is reserved for the " & ThisWorkbook.Name
& " !"
End If
End Sub
MP
"DDLY" <[email protected]> a écrit dans le message de
Dear all, I just would like to know how could I prevent the opening of
second workbook while the first workbook is opened or in using. Great
thanks!
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.