Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ChartType anomaly (Excel)

Status
Not open for further replies.

Stretchwickster

Programmer
Apr 30, 2001
1,746
GB
I have a chart which varies in ChartType. It is either a xlColumnClustered or xlLineMarkers (with Series.Border.LineStyle = xlNone) chart. In another part of code I need to check which ChartType the chart is currently set to. The constant represented by xlLineMarkers is 65 and this is recognised properly initially. However, when the following line is executed the ChartType value becomes -4111 instead of 65:
Code:
ActiveChart.SeriesCollection(1).Border.LineStyle = xlNone
So when I do
Code:
if ActiveChart.ChartType = xlLineMarkers then
it doesn't recognise the Chart as being of that type, even when it actually is!

Why does this change occur to the ChartType when the LineStyle is set? And is it best to check the ChartType against -4111 to recognise it? Clive [infinity]
 
I know this is a copout, but couldn't you check for
.ChartType <> xlColumnClustered
if you only have two possible settings for this property?
Rob
[flowerface]
 
Yes I was thinking that ;-) but wanted to make it a bit more readable! Clive [infinity]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top