Private Sub CommandButton3_Click()
Dim chemin$, w, h
chemin = ThisWorkbook.Path
Application.ScreenUpdating = False
Application.DisplayAlerts = False
On Error Resume Next 's'il n'y a rien dans le presse-papiers
Image1.Picture = LoadPicture("") 'RAZ
With Sheets.Add 'nouvelle feuille
.Paste
.Shapes(1).Select
If TypeName(Selection) <> "Range" Then
w = Selection.Width: h = Selection.Height
With .ChartObjects.Add(0, 0, w, h).Chart
.Paste
.Export chemin & "\MonImage.jpg", "JPG"
End With
Image1.Picture = LoadPicture(chemin & "\MonImage.jpg")
Kill chemin & "\MonImage.jpg"
End If
.Delete 'suppression de la nouvelle feuille
End With
[A1].Copy [A1] 'facultatif, vide le presse-papiers
Application.ScreenUpdating = True
End Sub
Private Sub CommandButton3_Click()
Dim chemin$, w, h
chemin = ThisWorkbook.Path
Application.ScreenUpdating = False
Application.DisplayAlerts = False
On Error Resume Next 's'il n'y a rien dans le presse-papiers
Image1.Picture = LoadPicture("") 'RAZ
With Sheets.Add 'nouvelle feuille
.Paste
.Shapes(1).Select
If TypeName(Selection) <> "Range" Then
w = Selection.Width: h = Selection.Height
With .ChartObjects.Add(0, 0, w, h).Chart
.Paste
.Export chemin & "\MonImage.jpg", "JPG"
End With
Image1.Height = Image1.Width * h / w
Image1.Picture = LoadPicture(chemin & "\MonImage.jpg")
Kill chemin & "\MonImage.jpg"
End If
.Delete 'suppression de la nouvelle feuille
End With
[A1].Copy [A1] 'facultatif, vide le presse-papiers
Application.ScreenUpdating = True
End Sub
SavePicture UserForm1.Image1.Picture, "C:\Users\Max\Desktop\ESSAIS.Gif"
Private Sub CommandButton3_Click()
Dim chemin$, w, h
chemin = "C:\Image\"
Application.ScreenUpdating = False
Application.DisplayAlerts = False
On Error Resume Next 's'il n'y a rien dans le presse-papiers
Image1.Picture = LoadPicture("") 'RAZ
With Sheets.Add 'nouvelle feuille
.Paste
.Shapes(1).Select
If TypeName(Selection) <> "Range" Then
w = Selection.Width: h = Selection.Height
With .ChartObjects.Add(0, 0, w, h).Chart
.Paste
.Export chemin & ComboBox1 & ".jpg", "JPG"
End With
Image1.Height = Image1.Width * h / w
Image1.Picture = LoadPicture(chemin & ComboBox1 & ".jpg")
End If
.Delete 'suppression de la nouvelle feuille
End With
[A1].Copy [A1] 'facultatif, vide le presse-papiers
Application.ScreenUpdating = True
End Sub
Private Sub CommandButton3_Click()
Dim chemin1$, chemin2$, w, h
chemin1 = "C:\Film\Acteurs\"
chemin2 = "C:\Film\Réalisateurs\"
Application.ScreenUpdating = False
Application.DisplayAlerts = False
On Error Resume Next 's'il n'y a rien dans le presse-papiers
Image1.Picture = LoadPicture("") 'RAZ
With Sheets.Add 'nouvelle feuille
.Paste
.Shapes(1).Select
If TypeName(Selection) <> "Range" Then
w = Selection.Width: h = Selection.Height
Image1.Height = Image1.Width * h / w
With .ChartObjects.Add(0, 0, w, h).Chart
.Paste
If CheckBox1 Then .Export chemin1 & ComboBox1 & ".jpg", "JPG": _
Image1.Picture = LoadPicture(chemin1 & ComboBox1 & ".jpg")
If CheckBox2 Then .Export chemin2 & ComboBox1 & ".jpg", "JPG": _
Image1.Picture = LoadPicture(chemin2 & ComboBox1 & ".jpg")
End With
End If
.Delete 'suppression de la nouvelle feuille
End With
[A1].Copy [A1] 'facultatif, vide le presse-papiers
Application.ScreenUpdating = True
End Sub