AW: Zellbereich als .jpg speichern
24.06.2021 20:27:06
Rolf
Hallo Andreas,
ein paar mehr Zeilen Code braucht's schon ;-)
Probier mal
Sub BildExport()
Dim chPic As ChartObject
Dim strBildName As String
Dim shBild As Picture
strBildName = "C:\Temp\Egal.jpg"
Range("A1:BK88").CopyPicture Appearance:=xlScreen, Format:=xlPicture
Application.Wait (Now + TimeValue("00:00:01"))
ActiveSheet.Paste
Set shBild = ActiveSheet.Pictures(ActiveSheet.Pictures.Count)
shBild.CopyPicture Appearance:=xlScreen, Format:=xlPicture
Set chPic = ActiveSheet.ChartObjects.Add(0, 0, shBild.Width, shBild.Height)
With chPic.Chart
.ChartArea.Select 'ohne Select wird nur ein leeres Bild kopiert!
.Paste
.Export Filename:=strBildName, FilterName:="jpg"
End With
chPic.Delete
shBild.Delete
Set chPic = Nothing
Set shBild = Nothing
End Sub
Gruß Rolf