1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| 'Création d'offre sous format word
Private Sub CommandButton1_Click()
Dim offre As String
Dim LeMontant As Integer
Dim LeTexte2
Dim ObjWord As Word.Application
Dim LeDocWord As Word.Document
'If CommandButton1.Accelerator = "O" Then
On Error Resume Next
'Creation d'objet word et ouvrir le fichier sous Word
offre = ThisWorkbook.Path & "\OFFRE_TECHNICO-ECONOMIQUE.doc"
Set ObjWord = CreateObject("Word.Application")
ObjWord.Visible = True
Set LeDocWord = ObjWord.Documents.Open(offre)
With LeDocWord
If Cells(14, 7) = "Surimposition" Then
.Bookmarks("s32").Range.Text = "Pour ce projet nous vous proposons une structure support de surimposition fixée sur la toiture."
.Bookmarks("s33").Range.Text = "Figure 5. Illustration d'une structure en surimposition"
.
ThisWorkbook.Worksheets("bilan annuel").Activate
ActiveSheet.ChartObjects("graphique113").Activate
ActiveChart.ChartArea.Select
ActiveChart.ChartArea.Copy
.Application.Selection.PasteSpecial Link:=True
'End With
End If |
Partager