Sub PartageClasseurÉcriture()
Dim WB As Workbook
Dim WB_Name As String
WB_Name = "H:\Téléchargements\SUIVI INSTRUCTEURS - ACCUEIL - ATELIER.xlsm"
If Not IsWorkBookOpen(WB_Name) Then
Set WB = Workbooks.Open(WB_Name)
Else
MsgBox WB_Name & " déjà ouvert !"
End If
End Sub
Function IsWorkBookOpen(FileName As String) As Boolean
Dim ff As Long
Dim ErrNo As Long
On Error Resume Next
ff = FreeFile()
Open FileName For Input Lock Read As #ff
ErrNo = Err
Close ff
On Error GoTo 0
Select Case ErrNo
Case 0: IsWorkBookOpen = False
Case 70: IsWorkBookOpen = True
Case Else: Error ErrNo
End Select
End Function