Sub ecran()
Dim WdApp As Object, WdDoc As Object
With Sheets("Echéancier")
Ref = .Range("B1")
Nom = .Range("B2")
End With
Chemin = "Q:\AAGP2\PDD GAZ\PDD\Dossiers PDD\En cours" & "\" & Nom & " " & Ref & "" & Nom
With Sheets("Copie").Range("A1:J170")
.Copy
End With
'Lancer une instance Word
Set WdApp = CreateObject("Word.Application")
'Rendre Word visible
WdApp.Visible = True
'Ouvrir le document Word
Set WdDoc = WdApp.Documents.Open(ThisWorkbook.Path & "" & "Masque.doc") 'indiquer le chemin du fichier modèle
With WdDoc
'Copie de la feuille 4 Excel
'Sheets(4).Copy
'Coller la feuille dans Word
WdApp.Selection.Paste
'Annuler le mode couper/copier
Application.CutCopyMode = False
.SaveAs Filename:=Chemin
.Close True
End With
WdApp.Quit
Set WdDoc = Nothing
Set WdApp = Nothing
ActiveSheet.Shapes("MonBouton2").Visible = True
Application.OnTime Now + TimeValue("00:00:02"), "EffacerMessage2"
End Sub
Sub EffacerMessage2()
ActiveSheet.Shapes("MonBouton2").Visible = False
End Sub