Nach Installation von Office 2007 funktioniert mein Programm nicht mehr.
Der Code bleibt immer hangen bei: ActiveChart.Location Where:=xlLocationAsObject, Name:="Data"
Was kann hier gemacht werden?
Code:
Application.StatusBar = "Make Chart Left..."
Range("AC10").Select 'Range("Z4").Select
Charts.Add
ActiveChart.ChartType = xlColumnClustered 'xlAreaStacked
ActiveChart.SetSourceData Source:=Sheets("Data").Range("Z3:Z" & Rijaantal_Links), PlotBy:= _
xlColumns
ActiveChart.SeriesCollection(1).XValues = Sheets("Data").Range("Y3:Y" & Rijaantal_Lengte)
ActiveChart.SeriesCollection(1).Name = "=Data!R1C26"
ActiveChart.Location Where:=xlLocationAsObject, Name:="Data"
With ActiveChart.Axes(xlCategory)
.HasMajorGridlines = False
.HasMinorGridlines = False
End With
With ActiveChart.Axes(xlValue)
.HasMajorGridlines = True
.HasMinorGridlines = False
End With
ActiveChart.HasLegend = False
ActiveChart.Axes(xlValue).Select
With ActiveChart.Axes(xlValue)
.MinimumScale = 0
.MaximumScaleIsAuto = True
.MinorUnitIsAuto = True
.MajorUnit = 0.5
.CrossesAt = 0
'.Crosses = xlAutomatic
.ReversePlotOrder = False
.ScaleType = xlLinear
End With
Selection.TickLabels.AutoScaleFont = False
With Selection.TickLabels.Font
.Name = "Arial"
.FontStyle = "Standaard"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
.Background = xlAutomatic
End With
ActiveChart.Axes(xlCategory).Select
With ActiveChart.Axes(xlCategory)
.CrossesAt = 1
.TickLabelSpacing = Sheets("Data").Range("Y" & Rijaantal_Lengte)
.TickMarkSpacing = Sheets("Data").Range("Y" & Rijaantal_Lengte)
.AxisBetweenCategories = True
.ReversePlotOrder = False
End With
Selection.TickLabels.AutoScaleFont = False
With Selection.TickLabels.Font
.Name = "Arial"
.FontStyle = "Standaard"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
.Background = xlAutomatic
End With
ActiveChart.PlotArea.Select
Selection.Height = 313
Selection.Top = 34
With Selection.Border
.Weight = xlHairline
.LineStyle = xlNone
End With
Selection.Fill.TwoColorGradient Style:=msoGradientHorizontal, Variant:=1
With Selection
.Fill.Visible = True
.Fill.ForeColor.SchemeColor = 34 '2 '34
.Fill.BackColor.SchemeColor = 37 '2 '24
End With
ActiveChart.Axes(xlCategory).Select
ActiveChart.PlotArea.Select
ActiveChart.ChartArea.Select
With Selection.Border
.Weight = 2
.LineStyle = -1
End With
Selection.Fill.TwoColorGradient Style:=msoGradientHorizontal, Variant:=1
With Selection
.Fill.Visible = True
.Fill.ForeColor.SchemeColor = 2 '34
.Fill.BackColor.SchemeColor = 2 '24
End With
ActiveChart.ChartTitle.Select
Selection.AutoScaleFont = False
With Selection.Font
.Name = "Arial"
.FontStyle = "Standaard"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
.Background = xlAutomatic
End With
ActiveChart.ChartArea.Select
With Selection.Border
.Weight = 1
.LineStyle = 0
End With
Selection.Shadow = False
If Sheets("Data").Range("AG1") > 0 Then
Call GroenRood
Else: Call BalkenKleur
End If