I wanted to build an awesome place for people to discuss module specific issues, but I don't have any more time for this, and there are much better places to discuss Perl-related issues. I'd recommend asking your question on Stack Overflow or on Perl Monks.
If you are looking for a Perl tutorial or Perl-related news, I hope these links will serve you well.
Posted on 2006-08-05 04:22:54-07 by shamus
MORE XL CHARTS

Win32::OLE and Excel Charts.

A single Y-axis-series is the trivial starting point for an Excel chart that we would want to extend to some useful number of series (less than the maximum 255). However, unlike VB, Win32::OLE does not seem to be able to properly define any of the new series at all.

In VB you can set Series-object "Values" to a Range-object, despite that it may be tricky to do under some conditions -- you may have to temporarily alter the "Type" of chart to do so -- or you may have to directly edit the corresponding part of the Series-object "Formula". It can be done, and with the telltale sting that reading those "Values"returns not a formula-string or object, but a VB-array ..{some hidden conversions going on there!}.

Neither of these techniques appears to work in Win32::OLE. With Range-objects you get a "Type mismatch" error ..(regardless of using the Add-method or NewSeries-method). With "Formula" editing you get the error "unable to set the Formula (or Values) property of the Series class" or your attempted property setting may be ignored without any error message if you take the trouble to wrap the setting-value in parenthesis and quotes.... (to match the form that Excel sometimes displays these formula-string-components in). Nor does it seem to matter whether your formula-strings use A1 or absolute-A1 or R1C1 notation for the Range references involved. [Against this, setting the XValues property (the X-axis values) to an R1C1-formula reference for new series seems to work fine, but is a fairly useless success if orphaned without any corresponding Y-Values ?].

I would love someone to disagree with these findings and induce me to not abandon Win32::OLE after all the effort?

ever hopeful!

shamus

Direct Responses: 3880 | Write a response