bshaner has asked for the wisdom of the Perl Monks concerning the following question:

First, Thanks so much for your Excel OLE tutorial it was great!

I am trying to automate creating a two axis chart.   It has 5 series of data. The first one uses a primary linear axis, the other 4 use a precentage secondary axis.   I created the chart using chart wizard and I am hitting a wall adding the secondary axis.

The VB example in the excell help file says to use Charts("Chart1").HasAxis(xlValue, xlPrimary) = True to activate a primary axis.   So I tried $Chart->{HasAxis(xlValue, xlSecondary)} = 'True'; and $Chart->HasAxis(xlValue, xlSecondary);

Neither work. The first failes with message from perl telling me the &HasAxis in Main is undefined and the second runs but any attmpt to use the secondary axis fails with a OLE error. I have been digging on this for a while can you help?

janitored by ybiC: PM link ([id://node_number]) to referenced tutorial, minor formatting cleanup

Replies are listed 'Best First'.
Re: Trouble adding a secondary Axis to an Excel chart
by tachyon (Chancellor) on Sep 25, 2003 at 11:44 UTC
      This is an interesting article, but I am looking to do this with perl and Excel.
      The program produces 3 worksheets of data and a chart . Producing the data sheets and the basic chart works great. (Thanks to the OLE tutorial)
      Now I just need to add the second axis to the chart and get 4 of the data series to use the secondary axis.

        Yes so you will need to know how it is done in VB.....because this is how you will do it using Win32::OLE and the chances of you finding VB code to do X on windows are high. The chances of finding an example in Perl using OLE is much lower.

        cheers

        tachyon

        s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print