Using ApplyCustomType with variable numbers and types of series  
Author Message
Bill Massie





PostPosted: Visual Basic for Applications (VBA), Using ApplyCustomType with variable numbers and types of series Top

Using our excel charting tool, users can create line/bar charts with varying numbers of line and bar series. e.g. They can generate a chart with revenue as a line series on the left axis and interest income, trust income and fees as bars on the right axis. I would like to apply a chart type using ApplyCustomType that would set the fonts and color scheme to our company standard, but it seems like the number and types of series in the Custom Type must match the number and type of series in the chart the user is creating. I created a standard template with one line and one bar series formatted the way I want it, but when I save that as a user-defined type and apply it, it makes the first series a line and every other series a bar regardless of the configuration of the series in the original chart. Is there a way around this

Thanks,

Bill Massie.



Microsoft ISV Community Center Forums1  
 
 
Jon Peltier





PostPosted: Visual Basic for Applications (VBA), Using ApplyCustomType with variable numbers and types of series Top

Don't use apply custom type. The custom types are inflexible.

Make your chart using a single type, then one by one change the type of each series you want to change. Also change the axis group to secondary if desired. It seems like more work than using a custom type, but if you think about it, it's been more work to use the custom template, because the custom template doesn't do what you want. Since you're using VBA anyway, after you do the initial code, it takes no longer to use.

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


 
 
Bill Massie





PostPosted: Visual Basic for Applications (VBA), Using ApplyCustomType with variable numbers and types of series Top

Thanks Jon. I was afraid that was the case, but hoping there might be a workaround. I'm actually using Interop w/DotNet but the situation is the same.