Re : bouton de comande
merci STephane
en fait j'ai un second problem, quand j'ai copié la première selection je n'arriv pas à écrire en vba une lettre dans une cellule avant de continuer sa bloc
lors de la selection de la ligne je vous met mon code ainsi qu'a l'endroit ou sa bloc
Dim wdApp As Object
Dim wd As Object
Dim img As Object
Dim schém As Object
On Error Resume Next
Set wdApp = GetObject(, "Word.Application")
If Err.Number <> 0 Then
Set wdApp = CreateObject("Word.Application")
End If
On Error GoTo 0
Dim Fich As String
Fich = Data.Range("Data_FichierWord")
Set wd = wdApp.Documents.Open(Fich)
wdApp.Visible = True
If Sheets("Data").Range("Data_choix") = "A" Then
Set img = Range("A1:L43")
img.CopyPicture xlScreen, xlPicture
Set schém = wd.Bookmarks("image")
schém.Range.PasteSpecial
End If
wdApp.Run "Macro1"
Windows("schéma_hydro_v2.xls").Activate
Sheets("Data").Range("Data_choix").Select 'sa bug ici ActiveCell.FormulaR1C1 = "B"
Call Afficherschémas_Click
'Afficherschémas = True
If Sheets("Data").Range("Data_choix") = "B" Then
Set img = Range("A1:L43")
img.CopyPicture xlScreen, xlPicture
Set schém = wd.Bookmarks("image2")
schém.Range.PasteSpecial
End If
wdApp.Run "Macro2"