I am using the Win32::OLE Perl module to change the pattern for a particular data point in a chart.
I can do this using:
$chart->SeriesCollection(2)->Points(5)->{Interior}->{Pattern} = xlPatternUp;
for example. To be clear this works exactly as expected.
However the xlPattern* constants only allow for a subset of the patterns Excel recognizes. It appears the full set of patterns is specified in the msoPattern* constants (at least the particular one I want to use is).
I tried to use one of the msoPattern* constants in the same manner:
$chart->SeriesCollection(2)->Points(5)->{Interior}->{Pattern} =
msoPatternWideUpwardDiagonal;
But this has no effect. The data point will render with a “solid” (default) pattern.
I have confirmed that I am importing the constants correctly, e.g.:
use Win32::OLE::Const 'Microsoft Office 12.0 Object Library';
How can I use the msoPattern* constants to change the pattern?
The msoPatterns can be changed via the
Patternedmethod of{Format}->{Fill}property.e.g.