Debug测试就是变粗细那里会把颜色统一变成蓝色,一个很呆的方法设置粗线前加一个变量记录初始颜色,设置完后直接用这个颜色变量。
Sub changeLine()
Dim MySeries As Series
Dim originColor As Variant
Dim i As Integer
On Error GoTo ErrorHandler
For Each MySeries In ActiveChart.SeriesCollection
color = MySeries.Format.Line.ForeColor.RGB
MySeries.Format.Line.Weight = 1
MySeries.Format.Line.ForeColor.RGB = color
Next
Exit Sub
ErrorHandler:
MsgBox "Please, select the chart before running this."
End Sub
Sub changeLine()
Dim MySeries As Series
On Error GoTo ErrorHandler
For Each MySeries In ActiveChart.SeriesCollection
MySeries.Format.Line.Weight = 1
Next
Exit Sub
ErrorHandler:
MsgBox "Please, select the chart before running this."
End Sub