A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Charts and Charting
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

accessing chart objects via VB



 
 
Thread Tools Display Modes
  #1  
Old October 27th, 2003, 04:18 PM
CycleMark
external usenet poster
 
Posts: n/a
Default accessing chart objects via VB

How do you discover and edit the attributes of chart
objects on a chart sheet from within the VB editor?

***************************************

Subject: VB editing -- multiple charts on a chart-
page
From: "Jon Peltier" Sent:
10/26/2003 5:35:29 PM

Actually, the Project Explorer only lists the chart
sheet, not any chart
objects on that sheet. If the chart sheet has a chart,
that chart has
no chart object. Chart objects are the containers that
hold an embedded
chart on its parent sheet.

The object model works like this. Assume you have only
one chart sheet,
so the sheet is ActiveWorkbook.Charts(1). Any chart
objects are
referenced by an index: ActiveWorkbook.Charts
(1).ChartObjects(1),
ActiveWorkbook.Charts(1).ChartObjects(2), etc.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
http://www.geocities.com/jonpeltier/Excel/index.html
_______

CycleMark wrote:
A single chart-sheet can contain multiple independent
charts. However, the VB "Project Explorer" hierarchy
shows only the *first* chart placed on the chart-sheet.
There doesn't appear to be a way to access the second,
third, nth chart on the chart-sheet from within the VB
editor. Does anyone know how to do this?


***************************************

Subject: precise positioning of objects
From: "Jon Peltier"

Sent:
10/22/2003 11:53:33 AM

You need to use VBA:

' Move and resize selected object
selection.left=5
selection.top=100
selection.height=55
selection.width=40

- Jon
-------
Jon Peltier, Microsoft Excel MVP
http://www.geocities.com/jonpeltier/Excel/index.html
_______

CycleMark wrote:


Is it possible to precisely position graphic objects in
an Excel diagram? There does not appear to be any
explicit position parameters.



  #2  
Old October 27th, 2003, 04:52 PM
Jon Peltier
external usenet poster
 
Posts: n/a
Default accessing chart objects via VB

Mark -

Please reply to the original thread. Splitting it like this is pretty
distracting.

You can type VBA statements in the Immediate window to change attributes:

activechart.SeriesCollection(1).name = "My Series"

or prefix with a question mark to see what they a

?activechart.SeriesCollection(1).name
My Series

- Jon
-------
Jon Peltier, Microsoft Excel MVP
http://www.geocities.com/jonpeltier/Excel/index.html
_______


CycleMark wrote:

How do you discover and edit the attributes of chart
objects on a chart sheet from within the VB editor?

***************************************

Subject: VB editing -- multiple charts on a chart-
page
From: "Jon Peltier" Sent:
10/26/2003 5:35:29 PM

Actually, the Project Explorer only lists the chart
sheet, not any chart
objects on that sheet. If the chart sheet has a chart,
that chart has
no chart object. Chart objects are the containers that
hold an embedded
chart on its parent sheet.

The object model works like this. Assume you have only
one chart sheet,
so the sheet is ActiveWorkbook.Charts(1). Any chart
objects are
referenced by an index: ActiveWorkbook.Charts
(1).ChartObjects(1),
ActiveWorkbook.Charts(1).ChartObjects(2), etc.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
http://www.geocities.com/jonpeltier/Excel/index.html
_______

CycleMark wrote:

A single chart-sheet can contain multiple independent
charts. However, the VB "Project Explorer" hierarchy
shows only the *first* chart placed on the chart-sheet.
There doesn't appear to be a way to access the second,
third, nth chart on the chart-sheet from within the VB
editor. Does anyone know how to do this?



***************************************


Subject: precise positioning of objects
From: "Jon Peltier"


Sent:

10/22/2003 11:53:33 AM

You need to use VBA:

' Move and resize selected object
selection.left=5
selection.top=100
selection.height=55
selection.width=40

- Jon
-------
Jon Peltier, Microsoft Excel MVP
http://www.geocities.com/jonpeltier/Excel/index.html
_______

CycleMark wrote:



Is it possible to precisely position graphic objects in
an Excel diagram? There does not appear to be any
explicit position parameters.





 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 05:58 PM.


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