Gruppe
Dialog
Problem
Wie kann ich in eine Userform ein Diagramm einfügen?
StandardModule: basMain
Sub GrafikInUserForm()
Const csMsg As String = "Die Statistikgrafik kann nicht " & _
"auf CD-ROM gespeichert werden. Speichern Sie die " & _
"Arbeitsmappe auf Ihrer Festplatte und versuchen " & _
"Sie es erneut."
Dim sFile As String
sFile = ThisWorkbook.Path & "\Statistik.gif"
On Error GoTo ERRORHANDLER
ActiveWorkbook.Charts(1).Export sFile
With frmChart
.imgChart.Picture = LoadPicture(sFile)
.imgChart.PictureSizeMode = fmPictureSizeModeZoom
.Show
End With
Kill sFile
Exit Sub
ERRORHANDLER:
MsgBox prompt:=csMsg
End Sub
ClassModule: frmChart
Private Sub cmdOK_Click()
Unload Me
End Sub