Combination chart using VB2005

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi, I've been hitting a brick wall with this one for the last couple of days.
I have a VB2005 application that outputs Excel spreadsheets and charts.

One of the chart types needed has two data sets on the same chart with axes
on the left and right. (Excel custom chart type 'Line - Column on 2 Axes'.)

The chart can be produced manually in Excel and using Excel VBA. The key VBA
statement seems to be:

..ApplyCustomType(ChartType:=xlBuiltIn, TypeName:="Line - Column on 2 Axes")

I have been unable to reproduce the equivalent of this statement within
VB2005.

Can anyone point me in the right direction?

Thanks
 
Can't help with VB2005, but there's an alternative which might work. (The
built-in custom types can be problematic, or at least sometimes not do what
is expected.)

Make the chart as a regular column chart. Convert one series to a line chart
type. Move one series to the secondary axis.

Use Excel's macro recorder to get the VBA code, then use whatever magic you
need to convert it to VB.net.

- Jon
 
Jon

A big thanks, your lateral thinking provided the solution - and a fairly
straight forward one at that.

Thanks again
 
Back
Top