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

I am seeking wisdom regarding the use of Win32::OLE and working with MS Excel. I have created a line graph and would like to change the color of the actual data lines. When recording a VB Macro and viewing the code, it gives no hints or details on changing the actual line color. So, I wonder, is it even possible to change? Thanks in advance!

Replies are listed 'Best First'.
Re: Win32::OLE and Excel Charts
by Corion (Patriarch) on Jun 09, 2011 at 13:09 UTC

      Corion, Thanks for the reply. The VB Macro is not showing the VB code to change the color. I will look at the MSDN documentation to see...

Re: Win32::OLE and Excel Charts
by Ratazong (Monsignor) on Jun 09, 2011 at 13:15 UTC

    Just a short comment related to the usage of charts with Win32::OLE and Excel: in my experience it is much easier in preparing all charts by hand in a template, and just exchange the source-data with perl. That way you would avoid the issue you are mentioning ...

    HTH, Rata

      Rata, That was one of my thoughts for performing this task. A question... how does one call a chart template in Perl?

Re: Win32::OLE and Excel Charts
by dasgar (Priest) on Jun 09, 2011 at 18:54 UTC

    Are you sure you recorded the macro correctly?

    I know for a fact that recording a macro will provide the VB code to do this task and it can be converted into Perl code that uses Win32::OLE. This is based on the fact that I've written Perl code to do exactly this and figured it out from recording a macro and looking at it's VB source code.

    If I can find the time, I'll try to find and dig up my code to see how I did it. In the meantime, you'll find that recording macros and the OLE browser from the Win32::OLE module will be among your best resources.