Dim Chrt As clsEventChartSpace
Dim CS As Control
Dim C As Object
Private Sub UserForm_Initialize()
If Renseigne Then
With Me
.Height = 360
.Width = 625
End With
Set CS = Me.Controls.Add("OWC11.ChartSpace.11")
With CS
.Top = Me.Top + 2
.Left = Me.Left + 2
.Height = Me.Height - 47
.Width = Me.Width - 8
Set C = .Constants
Set CHT = .Charts.Add
End With
Set LB = Me.Controls.Add("forms.Label.1")
With LB
.Top = CS.Height + 5
.Left = 10
.Height = 10
.Width = 180
End With
With CHT
.Type = C.chChartTypeLineMarkers
.SeriesCollection.Add
.SetData C.chDimCategories, C.chDataLiteral, DATA1
.SeriesCollection(0).SetData C.chDimValues, C.chDataLiteral, DATA2
.SeriesCollection(0).Interior.Color = 240 'RGB(0, 0, 240)
End With
'--- Pour les évènements ---
Set Chrt = New clsEventChartSpace
Set Chrt.myChartSpace = CS
'---------------------------
Else
Me.Caption = "Ne pas lancer directement le UserForm à partir de lui-même"
End If
End Sub
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
Set LB = Nothing
Set C = Nothing
Set CHT = Nothing
Set CS = Nothing
Set Chrt = Nothing
End Sub