using vba to copy user-defined chart type

P

Papa Jonah

My vba makes charts in Excel. I have a file that contains all of the code
and is used to generate other files with the charts. The charts have a
user-defined type. This means that others can not use the file unless they
have the same definitions.
I have hidden a sheet with a chart and tried to make the code "add" the
definition when it runs so that when it generates the charts the definition
will be there. However, it doesn't work.
This is what I have:
Sheets("Control Chart").Select
ActiveChart.ChartArea.Select
Application.AddChartAutoFormat Chart:=ActiveChart, Name:="willy", _
Description:=""
ActiveChart.ApplyCustomType ChartType:=xlUserDefined, TypeName:="willy"

Any ideas?

TIA
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top