Weird line chart VBA problem

Siyanna

Well-known Member
Joined
Nov 7, 2011
Messages
1,146
Hi

I have a simple code where I change the line chart type to dotted - I have 4 lines of data (4 series)

When I step through the code - the lines specified change to dash but for some reason when I run the code in 1 go - it changes my line to a normal line

is this a bug?

I am using excel 2013

Here is the code snippet I am running - my charts are named Chart01 - Chart02 etc

I have even put DoEvents but that don't work either

Dim i As Long

For i = 1 To 5
Worksheets("DailyView2").ChartObjects("Chart0" & i).Activate
With ActiveChart
.SeriesCollection(3).Format.Line.DashStyle = msoLineSysDot
.SeriesCollection(3).Border.Color = RGB(128, 128, 128)
.SeriesCollection(3).Format.Line.Weight = 1.5
.SeriesCollection(4).Format.Line.DashStyle = msoLineSysDot
.SeriesCollection(4).Border.Color = RGB(0, 0, 0)
.SeriesCollection(4).Format.Line.Weight = 1.5
End With
Next i
 
fiddle with the order they are processed


.SeriesCollection(4).Border.Color = RGB(0, 0, 0)
.SeriesCollection(4).Format.Line.Weight = 1.5
.SeriesCollection(4).Format.Line.DashStyle = msoLineSysDot

sometimes one application changes the next
 
Upvote 0

Forum statistics

Threads
1,226,838
Messages
6,193,260
Members
453,786
Latest member
ALMALV

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top