Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 3
Default Set the line weight with VBA in Excel 07

I applied a chart style to a chart. I had the macro recorder on while I
manipulated the chart. I saw the code to change the default size of the
marker, but I could not get any code to appear for adjusting the line weight
of the data series while a chart style is applied. I looked in the series
object model and don't see a property by which to set the line weight. The
old Border property in 03 is gone.

How should I adjust this programatically?

Thanks.

TL
  #2   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 2,489
Default Set the line weight with VBA in Excel 07

Hi,

Try,

activechart.SeriesCollection(1).format.line.weight =3

Cheers
Andy

TroyLee wrote:
I applied a chart style to a chart. I had the macro recorder on while I
manipulated the chart. I saw the code to change the default size of the
marker, but I could not get any code to appear for adjusting the line weight
of the data series while a chart style is applied. I looked in the series
object model and don't see a property by which to set the line weight. The
old Border property in 03 is gone.

How should I adjust this programatically?

Thanks.

TL


--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
  #3   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 3
Default Set the line weight with VBA in Excel 07



activechart.SeriesCollection(1).format.line.weight =3

Cheers
Andy


Ok Andy. Now I'm really confused. I looked at the SeriesCollections and the
Series object. Only under the Series object does Format appear and it says
that it is Read only. Additionally, there are no properties associated with
the Format property according to the MSDN site. So, while the above may work
(as I'll find it out in a moment), how is that you knew the syntax especially
considering the macro recorder does not write this code?

Thanks for the immediate help.

TL
  #4   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 6,582
Default Set the line weight with VBA in Excel 07

It's not clear? Can't you speak Microsoftese?

This bothered me a great deal while I tried for months to make sense of the
new model for formatting. Here is what you need to keep in mind:

Format is read-only. Format contains objects which are not read-only.

Andy has had the patience to do a lot of experimentation with the new object
model, using dummy charts and the Object Browser in the VB Editor. He
probably has tried to rely on the help files, but they are pretty unhelpful,
even by Microsoft's standards.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services, Inc.
http://PeltierTech.com/WordPress/
_______


"TroyLee" wrote in message
...


activechart.SeriesCollection(1).format.line.weight =3

Cheers
Andy


Ok Andy. Now I'm really confused. I looked at the SeriesCollections and
the
Series object. Only under the Series object does Format appear and it says
that it is Read only. Additionally, there are no properties associated
with
the Format property according to the MSDN site. So, while the above may
work
(as I'll find it out in a moment), how is that you knew the syntax
especially
considering the macro recorder does not write this code?

Thanks for the immediate help.

TL



  #5   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 3
Default Set the line weight with VBA in Excel 07



"Jon Peltier" wrote:

It's not clear? Can't you speak Microsoftese?

This bothered me a great deal while I tried for months to make sense of the
new model for formatting. Here is what you need to keep in mind:

Format is read-only. Format contains objects which are not read-only.

Andy has had the patience to do a lot of experimentation with the new object
model, using dummy charts and the Object Browser in the VB Editor. He
probably has tried to rely on the help files, but they are pretty unhelpful,
even by Microsoft's standards.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services, Inc.
http://PeltierTech.com/WordPress/
_______


"TroyLee" wrote in message
...


activechart.SeriesCollection(1).format.line.weight =3

Cheers
Andy


Ok Andy. Now I'm really confused. I looked at the SeriesCollections and
the
Series object. Only under the Series object does Format appear and it says
that it is Read only. Additionally, there are no properties associated
with
the Format property according to the MSDN site. So, while the above may
work
(as I'll find it out in a moment), how is that you knew the syntax
especially
considering the macro recorder does not write this code?

Thanks for the immediate help.

TL



Jon,
Thanks for the insight. Where can one find these hidden, mystical properties
if not in the Language Reference Manual? Does your website cover the
properties/objects of the Format property?

Thanks.

Troy


  #6   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 2,489
Default Set the line weight with VBA in Excel 07

As Jon points out I have done some poking around :)

It is not very clear but it is discoverable.

I start by creating a Series object in order to get intellisense to
provide me with valid items. So a small bit of code like this will
reveal the Format object.

Dim objSeries As Series

Set objSeries = ActiveSheet.ChartObjects(1).Chart.SeriesCollection (1)

With objSeries.Format
.Line.Weight = 2
End With

This is the path I took through the help file.
In the code I highligheted SeriesCollection and pressed F1. Then
followed this links. Some of the links are within the descriptive text
others in the See Also section of the page.

Chart.SeriesCollection Method
(a Series object)
Series Object Members
Properties: Format
ChartFormat object
ChartFormat Object Members
Line
LineFormat object
LineFormat Object Members
Weight

Luckily Weight is one of the more obverse properties. Some are more
hidden and other just do not exist.

Cheers
Andy

TroyLee wrote:
activechart.SeriesCollection(1).format.line.weig ht=3

Cheers
Andy



Ok Andy. Now I'm really confused. I looked at the SeriesCollections and the
Series object. Only under the Series object does Format appear and it says
that it is Read only. Additionally, there are no properties associated with
the Format property according to the MSDN site. So, while the above may work
(as I'll find it out in a moment), how is that you knew the syntax especially
considering the macro recorder does not write this code?

Thanks for the immediate help.

TL


--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
  #7   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 6,582
Default Set the line weight with VBA in Excel 07

As Andy and I have said, it's in the Object Browser and in IntelliSense.
Make a dummy chart with some dummy series, and just keep poking around.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services, Inc.
http://PeltierTech.com/WordPress/
_______


"TroyLee" wrote in message
...


"Jon Peltier" wrote:

It's not clear? Can't you speak Microsoftese?

This bothered me a great deal while I tried for months to make sense of
the
new model for formatting. Here is what you need to keep in mind:

Format is read-only. Format contains objects which are not read-only.

Andy has had the patience to do a lot of experimentation with the new
object
model, using dummy charts and the Object Browser in the VB Editor. He
probably has tried to rely on the help files, but they are pretty
unhelpful,
even by Microsoft's standards.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services, Inc.
http://PeltierTech.com/WordPress/
_______


"TroyLee" wrote in message
...


activechart.SeriesCollection(1).format.line.weight =3

Cheers
Andy


Ok Andy. Now I'm really confused. I looked at the SeriesCollections and
the
Series object. Only under the Series object does Format appear and it
says
that it is Read only. Additionally, there are no properties associated
with
the Format property according to the MSDN site. So, while the above may
work
(as I'll find it out in a moment), how is that you knew the syntax
especially
considering the macro recorder does not write this code?

Thanks for the immediate help.

TL



Jon,
Thanks for the insight. Where can one find these hidden, mystical
properties
if not in the Language Reference Manual? Does your website cover the
properties/objects of the Format property?

Thanks.

Troy



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Change Box Line Weight - Excel 2007 RAH[_2_] Excel Discussion (Misc queries) 2 July 14th 07 12:46 AM
Weight loss line chart to monitor weight loss progress S Fox Charts and Charting in Excel 6 November 8th 05 05:10 PM
Default Line Weight in Excel KCollard Charts and Charting in Excel 2 March 30th 05 02:57 PM
How can i change the default line weight in an excel chart NPG Charts and Charting in Excel 1 March 30th 05 03:57 AM
How can i change the default line weight in an excel chart Nigel Charts and Charting in Excel 0 March 30th 05 03:38 AM


All times are GMT +1. The time now is 07:51 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"