AW: Vorschau aus Arbeitsblatt in Userform?
13.02.2007 14:13:20
Bertram
Hallo Frank,
hilft dir das weiter?
Sub ScreenShotInUF()
Application.ScreenUpdating = False
Dim bild As Chart
Dim ws As Worksheet
Set ws = ThisWorkbook.ActiveSheet
Selection.CopyPicture 'statt selection kann natürlich ein fixer bereich gewählt werden!!!
Set bild = Charts.Add
On Error Resume Next
bild.ChartArea.Clear
bild.Location Where:=xlLocationAsObject, Name:=ws.Name
Set bild = ActiveChart
bild.Paste
With ActiveSheet.Shapes(Right(bild.Name, InStr(1, bild.Name, "Dia") + 1))
.Height = Selection.ShapeRange.Height + 5
.Width = Selection.ShapeRange.Width + 5
bild.Export Filename:="c:\temp\screen.gif", filterName:="gif"
.Delete
End With
Application.ScreenUpdating = True
UserForm1.Image1.Picture = LoadPicture("c:\temp\screen.gif")
End Sub
Gruß
Bertram