ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Get parameters to create existing chart (https://www.excelbanter.com/excel-programming/403589-get-parameters-create-existing-chart.html)

Matt Williamson

Get parameters to create existing chart
 
I'm looking for a way to get all of the paramters used for creating a chart
so I can do it dynamically. Someone else created a fairly complicated chart
and I'd like to be able to re-create it in code so I can change the data
range and title but I'm not sure how. It's complicated enough that I haven't
been able to re-create it manually yet (so I can just record it and get the
params that way) I've been reading all of the dynamic chart code in the MS
KB and various websites, but I haven't found any code to document an
existing chart to create it dynamically.

TIA

Matt



Jon Peltier

Get parameters to create existing chart
 
Essentially you have to find all of the properties for all of the elements
in the chart. It's not really hard, but it's intricate and tedious work. I
am in the process of quoting on such a utility, which may eventually become
a commercial product.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"Matt Williamson" wrote in message
...
I'm looking for a way to get all of the paramters used for creating a
chart so I can do it dynamically. Someone else created a fairly
complicated chart and I'd like to be able to re-create it in code so I can
change the data range and title but I'm not sure how. It's complicated
enough that I haven't been able to re-create it manually yet (so I can
just record it and get the params that way) I've been reading all of the
dynamic chart code in the MS KB and various websites, but I haven't found
any code to document an existing chart to create it dynamically.

TIA

Matt




Matt Williamson

Get parameters to create existing chart
 


Essentially you have to find all of the properties for all of the elements
in the chart. It's not really hard, but it's intricate and tedious work. I
am in the process of quoting on such a utility, which may eventually
become a commercial product.


Thanks John. I took a little time yesterday to play with the object model,
so I know what has to be done now. I was just hoping someone else had
already done it ;) I'm kind of in a time crunch and have 8 other projects
I'm actively working on so I don't really have time to write the code. I've
worked around it by clearing the data range, the title and a text box on the
chart and using it as a template. Then I just fill in those values when I
create new copies of the workbook in code. Not as elegant as creating the
whole thing from scratch, but it'll get me by for now.



"Matt Williamson" wrote in message
...
I'm looking for a way to get all of the paramters used for creating a
chart so I can do it dynamically. Someone else created a fairly
complicated chart and I'd like to be able to re-create it in code so I
can change the data range and title but I'm not sure how. It's
complicated enough that I haven't been able to re-create it manually yet
(so I can just record it and get the params that way) I've been reading
all of the dynamic chart code in the MS KB and various websites, but I
haven't found any code to document an existing chart to create it
dynamically.

TIA

Matt






Jon Peltier

Get parameters to create existing chart
 
Actually, for most cases, creating and applying a custom chart type should
be adequate. In my case, I've hosed the Office installation, and my custom
user gallery is corrupted.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"Matt Williamson" wrote in message
...


Essentially you have to find all of the properties for all of the
elements in the chart. It's not really hard, but it's intricate and
tedious work. I am in the process of quoting on such a utility, which may
eventually become a commercial product.


Thanks John. I took a little time yesterday to play with the object model,
so I know what has to be done now. I was just hoping someone else had
already done it ;) I'm kind of in a time crunch and have 8 other projects
I'm actively working on so I don't really have time to write the code.
I've worked around it by clearing the data range, the title and a text box
on the chart and using it as a template. Then I just fill in those values
when I create new copies of the workbook in code. Not as elegant as
creating the whole thing from scratch, but it'll get me by for now.



"Matt Williamson" wrote in message
...
I'm looking for a way to get all of the paramters used for creating a
chart so I can do it dynamically. Someone else created a fairly
complicated chart and I'd like to be able to re-create it in code so I
can change the data range and title but I'm not sure how. It's
complicated enough that I haven't been able to re-create it manually yet
(so I can just record it and get the params that way) I've been reading
all of the dynamic chart code in the MS KB and various websites, but I
haven't found any code to document an existing chart to create it
dynamically.

TIA

Matt









All times are GMT +1. The time now is 02:26 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com