Bonjour,
J'ai réalisé un code pour des signatures mais lors de la création de ces dernières, cela bug .
Lors du passage en pas à pas, il n'y a pas de soucis.
Les endroits ou le code s'arrête est signalé par une flèche.
Je peux fournir le fichier si besoin.
Merci d'avance
Private Sub Signature_Click()
Dim Plage As Range
Dim fichier As String
Application.ScreenUpdating = False
With Sheets("GESTION")
.Unprotect (Sheets("GESTION").Range("B3").Value)
.Activate
.Range("M2").Value = ComboBox2 & " " & TextBox1 & " " & TextBox2
.Range("M3").Value = TextBox5
.Range("M4").Value = ComboBox3
'__________________________________________________
'ajouter l'image de la Cie
'__________________________________________________
Set Plage = .Range("M2:P4")
Plage.VerticalAlignment = xlCenter
Plage.HorizontalAlignment = xlCenter
---> Plage.CopyPicture xlScreen, xlBitmap
---> Plage.PasteSpecial
.Shapes(.Shapes.Count).Copy
With .ChartObjects.Add(Plage.Left, Plage.Top, Plage.Width, Plage.Height).Chart
.ChartArea.Select
.Paste
.Export (ThisWorkbook.Path & "\" & "signaturetemp" & ".jpg")
End With
Gestion_personnel.Image1.Picture = LoadPicture(ThisWorkbook.Path & "\" & "signaturetemp" & ".jpg")
.Shapes(.Shapes.Count).Delete
.Shapes(.Shapes.Count).Delete
.Protect (Sheets("GESTION").Range("B3").Value)
End With
Set Plage = Nothing
Kill ThisWorkbook.Path & "\" & "signaturetemp" & ".jpg"
Sheets("PERSONNEL DESIGNE").Activate
CheckBox3 = True
Application.ScreenUpdating = True
End Sub