Sub JPG_tisk()
Dim rng As Excel.Range
'Set rng = Range("A1:O44")
'Find the last used row in a Column: column A in this example
Dim LastRow As Long
With ActiveSheet
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
End With
'MsgBox LastRow
'Find the last used column in a Row: row 1 in this example
Dim LastCol As Integer
With ActiveSheet
LastCol = .Cells(1, .Columns.Count).End(xlToLeft).Column
End With
'MsgBox LastCol
Set rng = Range("A1", Cells(LastRow, LastCol))
If ExportRangeToPicture(rng, "d:\rreange.png") Then
'MsgBox "ok!"
Else
MsgBox "Didn't work"
End If
End Sub
Pozn. vím že název obsahuje JPG a ukládám to jako PNG, je to z důvodu že při png nedochází ke kompresi, byla to pozdější úprava