I tried to emulate a sankey chart with a line chart in excel 2021. (for having direct access to the Charts events i use a chart as Chartsheet) I have 36 lines within this chart and i use the Series.format.line.weight property for changing the weight for each line. The line weight is taken by code from a range in a Worksheet. All my code works fine but if i change the values in the range for the line.weight by looping through, the changes don’t reliable take effect on the properties of the chart
part of my code:
for i = 1 to 36
myChart.Format.Line.Weight = theLineWeight(i)
‘ theLineWeight(i) reads the i.th value from a range containing the values for the weights
next i
this code sometimes works and sometimes not. I can’t figure out, on what conditions the code has effect and on what not…
I tried to refresh the Chart by myChart.refresh after each property change, i also tried if there is an effect if i deselect the Chart by activating another sheet and selecting a range within. Another try was changing the charts visibilty. All tries didn’t really effect. What can i do?
Andi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.