Chart's objects' properties

  • Thread starter Thread starter L Mehl
  • Start date Start date
L

L Mehl

Hello --

Can someone suggest a source for code which loops through all of a chart's
properties, and the properties of all of its elements?

Thanks for any help.

Larry Mehl
 
If you look at the XL object model, you will find that your request
would constitute a large -- very, very large -- amount of data!

--
Regards,

Tushar Mehta, MS MVP -- Excel
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions
 
Tushar Mehta said:
If you look at the XL object model, you will find that your request
would constitute a large -- very, very large -- amount of data!

--
Regards,

Tushar Mehta, MS MVP -- Excel
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

Hi,

How would you go about writing the code to do it though?

Is it possible to get a worksheet listing of an object, and all of
those subsidiary elements including, where applicable, values of
parmaters that can change?

I guess you would have to define the object specifically, but what
about listing all of the objects of that type in a given worksheet
(say), or even a whole workbook?

Also, what about passing a class of objects and having it drill down
into each possible element?

Perhaps you could pass a parameter that decided how many levels to
drill down (for example one level below a class would just list all
the members, but not their properties for example).

Any ideas on how it could be written even if it would be slow and a
large amount of data?

Alan.
 
Thanks Tushar and Alan --

I still want to do it, so I can write code for the properties changed from
their default settings, and allow for users to change them again, through a
friendly UI.

Larry
 
The existing UI is pretty good for user formatting of chart elements.
What could be easier or faster than double clicking or right clicking?
All you'd need to do is (a) educate the users into the more obscure
features, or (b) write a much smaller bit of code for those features you
want to offer specific options for.

For the other aspect, looping through methods and properties to archive
the settings, you might look at the type library stuff on Chip Pearson's
web site (http://cpearson.com). It might allow some kind of

For each Property in ActiveChart.Property
MyProperty.Value = ActiveChart.Property.Value
Next

But I still think a custom type or a template would be way easier.

- Jon
 
Hi Jon --

Thanks for this reference.

His GetInfo function looks interesting. I have written him for information
on how to get a list of values for his second argument "PropertySpec". I
suspect it is the list of properties I mentioned in my original message to
this group.

Larry
 
Jon Peltier said:
The existing UI is pretty good for user formatting of chart
elements. What could be easier or faster than double clicking or
right clicking?

All you'd need to do is (a) educate the users into the more obscure
features, or (b) write a much smaller bit of code for those features
you want to offer specific options for.

For the other aspect, looping through methods and properties to
archive the settings, you might look at the type library stuff on
Chip Pearson's web site (http://cpearson.com). It might allow some
kind of

For each Property in ActiveChart.Property
MyProperty.Value = ActiveChart.Property.Value
Next

But I still think a custom type or a template would be way easier.

- Jon

Hi Jon,

Sorry for the late reply.

I had a look through Chip Pearson's site as you suggested but I
couldn't see the section you referred to.

I used the on site search facility too but no luck there:

http://search.freefind.com/find.html?pageid=r&id=6958140&mode=ALL&query=type+library&lang=en&fr=0


I realise that this is a big ask, but could you possibly post a URL to
the section on the site that covers this topic?

For convenience, this is the URL to his excel header page:

http://cpearson.com/excel.htm

Thanks in advance for any help you are able to provide.

Alan.
 
Alan -

Try this out (quoted from near the bottom of http://cpearson.com/excel.htm):

Download XLTLI - Type Lib Utilities
http://cpearson.com/Zips/TLIUtils.ZIP
This download provides about 20 VBA utility functions for working with
the TypeLib Information object library, which is used to read type
libraries. TypeLib Info is the "engine" behind the VBA Object Browser,
and this library gives you programmatic access to type libraries,
allowing you to determine the various arguments for methods, the
symbolic names of constants, the methods of an object and so on.
Complete documentation is in the VBA code of this workbook. This code
is for advanced VBA programmers, not novices. An advanced version of
XLTLI is available for commercial customers.

- Jon
 
Jon Peltier said:
Alan -

Try this out (quoted from near the bottom of
http://cpearson.com/excel.htm):

Download XLTLI - Type Lib Utilities
http://cpearson.com/Zips/TLIUtils.ZIP
This download provides about 20 VBA utility functions for working with
the TypeLib Information object library, which is used to read type
libraries. TypeLib Info is the "engine" behind the VBA Object Browser,
and this library gives you programmatic access to type libraries,
allowing you to determine the various arguments for methods, the
symbolic names of constants, the methods of an object and so on.
Complete documentation is in the VBA code of this workbook. This code
is for advanced VBA programmers, not novices. An advanced version of
XLTLI is available for commercial customers.

- Jon

Thanks Jon - Much appreciated.

Alan.
 
Back
Top