For "Marker Line Style" see Point.Format.Line.Weight

S

SysMod

This is not a question, just a place to record the answer to this question in
case somebody else searches for it; or I forget again in the future.

I wanted to know: What object do I use to set the heaviness of the lines in
a chart point marker? Not the series line, the point marker eg the asterisk
xlMarkerStyleStar

In the UI it's right-click, Format Data Point
Marker Line style, Width 2pt say.

In VBA I can set oPoint.MarkerStyle = xlMarkerStyleStar

but I can't find any reference to "Marker Line Style" and neither did this
newsgroup - until now I guess.

And of course the macro recorder in Excel 2007 is broken and does not
record many chart object changes.

The magic word to think of searching for is "Weight"

the answer is for a weight of 2, set

Point.Format.Line.Weight=2
 
M

mischab1

Thanks for writing about this. I spent several hours trying to figure out
how to reduce Line Width and it never once occured to me to look at Format.
In my case I needed to change the Series line width.

Series.Format.Line.Weight = 1 worked perfectly.

(Excel 2007 offers 6 different chart styles with 8 different color
combinations and I hate every one.)
 
S

SysMod

One more wrinkle:
Setting the marker weight draws a line from the previous point to this one
(why? whatever for? is this documented anywhere?)

oPoint.Format.Line.Weight = xlThin ' =2; xlthick=4

To then remove the unwanted lines that are added, do

' Finally remove the pesky lines that Excel adds to the star points
oChart.SeriesCollection(1).Border.LineStyle = xlLineStyleNone ' Excel 2007
macro recorder does not record this
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top