Private Sub Workbook_BeforeClose(Cancel As Boolean)
If MsgBox("Do you really want to share this report", vbYesNo, "Demande de confirmation") = vbYes Then
'Copie du Rapport
Sheets("Resume").Select
Sheets("Resume").Copy
Dim Repertoire As String
Dim Fichier As String
'Envoi du Rapport sous Sharepoint
Repertoire = "https://Documents/CC-France/Order%20Book%202018/Report%20Project%20Managers.xlsx?Web=1"
Fichier = Sheets(Resume).Cells(3, 1)
FichierPath = Repertoire & "/" & Fichier
ActiveWorkbook.SaveAs Filename:=FichierPath
ActiveWindow.Close
MsgBox ("Your report has been saved")
End If
'Suppression du rapport à la fermeture
Rows("2:3000").Select
Selection.Delete Shift:=xlUp
Range("A1").Select
If ThisWorkbook.Saved = False Then
ThisWorkbook.Save
End If
End Sub