ich will ein Bild, was auf dem Reiter "Changelog" liegt exportieren als jpeg.
Dazu lege ich einen Chart an, füge das Bild ein und exportiere den Chart.
Problem: Es wird nur der leere Chart exportiert ohne Bild und ich bekomme es nicht hin Bild+Chart zu gruppieren.
Kann mir wer helfen?
Code:
Sub BilderExportierenShape()
Worksheets("changelog").Unprotect Password:=PassKey
Dim shBild As Shape
Set shBild = Worksheets("changelog").Shapes(1)
BildExportShape shBild
Set shBild = Nothing
Worksheets("changelog").Protect Password:=PassKey
End Sub
Sub BildExportShape(shExport As Shape)
Dim Pfad As String
Dim chDiagramm As ChartObject
Worksheets("changelog").Unprotect Password:=PassKey
Pfad = ActiveWorkbook.Path
Application.ScreenUpdating = False
shExport.CopyPicture Appearance:=xlScreen, Format:=xlPicture
Set chDiagramm = Worksheets("changelog").ChartObjects.Add(0, 0, shExport.Width, shExport. _
Height)
With chDiagramm.Chart
.Paste
.Export Filename:=Pfad & "\Bild1.jpg", FilterName:="JPG" '
End With
chDiagramm.Delete
Set chDiagramm = Nothing
Set shExport = Nothing
Application.ScreenUpdating = True
Worksheets("changelog").Protect Password:=PassKey
End Sub
Danke und Gruß,Alex