ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Charts and Charting in Excel (https://www.excelbanter.com/charts-charting-excel/)
-   -   Combination chart using VB2005 (https://www.excelbanter.com/charts-charting-excel/118836-combination-chart-using-vb2005.html)

Ventuspilot

Combination chart using VB2005
 
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



Jon Peltier

Combination chart using VB2005
 
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 Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Ventuspilot" wrote in message
...
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





Ventuspilot

Combination chart using VB2005
 
Jon

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

Thanks again




All times are GMT +1. The time now is 05:07 PM.

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