Hallo Reinhard,
habs mittlerweile selbst hinbekommen, den Code poste ich im Anschluss. Ist zwar nicht die eleganteste Lösung, trifft mein Problem aber ziemlich genau.
Viele Grüße, Achim
Dim Höhe As Double
ActiveSheet.Select
Range(„A1“).Select
zanzahl = 36
ReDim dummyh(zanzahl) As Double
For i = 1 To zanzahl
dummyh(i) = ActiveCell.Rows(„1:1“).EntireRow.RowHeight
Höhe = Höhe + dummyh(i)
Next i
Dim Breite As Double
ActiveSheet.Select
Range(„A1“).Select
sanzahl = 78
ReDim dummyb(sanzahl) As Double
For i = 1 To sanzahl
dummyb(i) = ActiveCell.Columns(„A:A“).EntireColumn.ColumnWidth
Breite = Breite + dummyb(i)
Next i
Dim oDia As Object, oChartArea As Object, oChartPic As Object
Dim iBreite As Single, iHoehe As Single, RetVal As Boolean, oBlatt As Object
Dim oBook As Object
Dim sTempPfad As String
On Error GoTo Fehler
Application.ScreenUpdating = False
Dim oShape As Range, sName As String
Set oShape = ActiveSheet.Range(„B1:BZ35“)
ActiveSheet.Range(„B1:BZ35“).CopyPicture 1, 2
Set oBook = Application.Workbooks.Add
Set oDia = oBook.ActiveSheet.ChartObjects.Add(0, 0, Breite * 8, Breite * 8 / 1.42)
Set oChartArea = oDia.Chart
oDia.Activate
With oChartArea
.ChartArea.Select
.Paste
Set oChartPic = .Pictures(1)
End With
With oChartPic
.Left = 0
.Top = 0
iBreite = Breite * 8
iHoehe = Breite * 8 / 1.42
End With
With oDia
.Border.LineStyle = xlNone
.Width = 3000
.Height = 2121
End With
RetVal = oChartArea.PrintOut
If Not RetVal Then
MsgBox „Bild wurde nicht gedruckt“, vbExclamation
Else
End If
Aufraeumen:
On Error Resume Next
Set oChartPic = Nothing
Set oChartArea = Nothing
Set oDia = Nothing
oBook.Saved = True
oBook.Close
Set oBook = Nothing
Application.ScreenUpdating = True
Exit Sub
Fehler:
MsgBox „Fehler beim Druck!“, vbExclamation
Resume Aufraeumen