Combination chart using VB2005

V

Ventuspilot

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
 
J

Jon Peltier

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
 
V

Ventuspilot

Jon

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

Thanks again
 

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