AW: Zwischenablage in Userform anzeigen und ...
01.10.2019 19:46:35
Nepumuk
Hallo Thomas,
so:
Private Sub CommandButton1_Click()
Dim objShape As Shape, objChartObject As ChartObject
Dim strPath As String
Application.ScreenUpdating = False
With Worksheets("Drucken")
.Paste Destination:=.Cells(41, 2)
If .Shapes.Count >= 1 Then
strPath = Environ$("TMP") & "\Test.jpg"
Set objShape = .Shapes(.Shapes.Count)
Set objChartObject = .ChartObjects.Add(Left:=0, Top:=0, _
Width:=objShape.Width, Height:=objShape.Height)
With objChartObject
Call .Chart.Paste
Call .Chart.Export(Filename:=strPath, FilterName:="JPG")
Set Image1.Picture = LoadPicture(strPath)
Call Kill(PathName:=strPath)
Call .Delete
End With
Else
Call MsgBox("Kein Bild in der Zwischenablage.", vbExclamation, "Hinweis")
End If
End With
Application.ScreenUpdating = True
Set objShape = Nothing
Set objChartObject = Nothing
End Sub
Gruß
Nepumuk