Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Chart Object Model

I'm trying to programically (from VB) udate the column
lables on a chart. I can create the chart (daily values
for the week) which creates 5 columns. I need to access
the property that will let me label each column with the
respective day. If I modify an existing chart I can right
click on it, go to Source Data, then the Series tab and
supply the range in "Category (X) axis labels". I can't
seem to figure out what property/method this is in the
chart object model so I can dynaically assign these
values.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Chart Object Model

Turn on the macro recorder (tools=Macro=record a new macro) while you make
that change manually. Then turn it off and look at the recorded code. That
should give you a good start. I would expect the XValues property.

--
Regards,
Tom Ogilvy

"Joe Maki" wrote in message
...
I'm trying to programically (from VB) udate the column
lables on a chart. I can create the chart (daily values
for the week) which creates 5 columns. I need to access
the property that will let me label each column with the
respective day. If I modify an existing chart I can right
click on it, go to Source Data, then the Series tab and
supply the range in "Category (X) axis labels". I can't
seem to figure out what property/method this is in the
chart object model so I can dynaically assign these
values.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 271
Default Chart Object Model

"Joe Maki" wrote:

I'm trying to programically (from VB) udate the column
lables on a chart.


Try the XValues property of the SeriesCollection for the bars. Something like

ActiveChart.SeriesCollection(1).XValues = "=Sheet1!R1C1:R1C5"

Using the right series collection, of course. You can assign a Range or an
Array to the XValues property.

ActiveChart.SeriesCollection(1).XValues = _
Array("Tue", "Wed", "Thu", "Fri", "Sat")

Usually, you can record a macro to get the names of object properties like
this. What a recorded macro won't tell you are the quirks of properties like
XValues. For example, you can assign a Range or an Array to XValues, but
when you read it, you get an Array, regardless of how it was set. There's no
way, for example, to tell what Range has been assigned to XValues. But you
may not need that here.

--Shawn

  #4   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Chart Object Model


ActiveChart.SeriesCollection(1).XValues = "=Sheet1!

R1C1:R1C5"

ActiveChart.SeriesCollection(1).XValues = _
Array("Tue", "Wed", "Thu", "Fri", "Sat")



I was able to get the array to work, not the range.
Thanks for the help, this at least makes it possible.

  #5   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Chart Object Model


-----Original Message-----
Turn on the macro recorder (tools=Macro=record a new

macro) while you make

Great tip, I've never used macro recorder. Time to
experiment <g
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
Excel object model Alan Hutchins Excel Programming 0 September 17th 04 11:32 AM
object model diagram Chris Wold Excel Programming 2 February 16th 04 11:13 PM
Where is the complete Object Model TBA[_2_] Excel Programming 3 December 12th 03 01:20 PM
Subtotals in object model? Josh Sale Excel Programming 2 October 21st 03 11:11 PM
Does MS Query have an object model Frank[_12_] Excel Programming 2 July 10th 03 10:54 PM


All times are GMT +1. The time now is 08:01 AM.

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

About Us

"It's about Microsoft Excel"