我正在尝试在 MS Powerpoint 的图表中创建水平和垂直误差线。虽然我可以使用 VBA 设置误差线的参数,但是误差线是不可见的。当我手动检查图表中的误差线设置时,所需的设置就完成了。下面是我正在尝试的代码:
ActivePresentation.Slides(SlideNumb).Shapes(ChartName).Chart.Select
With ActivePresentation.Slides(SlideNumb).Shapes(ChartName).Chart.SeriesCollection(2)
.HasErrorBars = True
.ErrorBars.Select
.ErrorBar Direction:=xlY, Include:=xlErrorBarIncludeBoth, Type:=xlErrorBarTypeCustom, Amount:=100, MinusValues:=100
.ErrorBar Direction:=xlX, Include:=xlErrorBarIncludeBoth, Type:=xlErrorBarTypeCustom, Amount:=100, MinusValues:=100
End With
With ActivePresentation.Slides(SlideNumb).Shapes(ChartName).Chart.SeriesCollection(2).ErrorBars.Border
.LineStyle = msoLineSingle
.Color = RGB(0, 112, 192)
.Weight = 1.5
End With
With ActivePresentation.Slides(SlideNumb).Shapes(ChartName).Chart.SeriesCollection(2).ErrorBars
.Select
.Format.Line.Visible = msoTrue
.Format.Line.Style = msoLineSingle
.Format.Line.Weight = 1.5
.Format.Line.ForeColor.RGB = RGB(0, 112, 192)
.Format.Line.DashStyle = msoLineSysDash
.EndStyle = xlNoCap
End With
请帮忙。