Perl Win32::OLE Microsoft Excel Set font size in chart legend and datatable

I'm not a Perl programmer and have inherited a Perl script that uses OLE animation to create data and charts in an Excel spreadsheet.

The charts have a terrible appearance primarily due to text font sizes -- at the normal 10-point size they take up enough room that the actual graph gets compressed and becomes useless.  I've made the charts look good in Excel by reducing the text point sizes -- I've set them to 3-point at the moment.

I've been able to update the Perl script to set font sizes for the chart title and the X and Y axis titles.

My problem is that I can't seem to do the same for the datatable and legend fonts.  The attached source contains
   #####################
   #Not a CODE reference
just before each of the two commented out lines representing my attempts to the set font sizes.  "Not a CODE reference" is the problem I'm seeing for each.
transfer.txt
LVL 13
josgoodAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

josgoodAuthor Commented:
Added Excel forum.
0
clockwatcherCommented:
The error you're getting is caused by the parens.  They should be curly brackets:

  $chart->(DataTable)->{Font}->{Size} = 3;

Should be:

  $chart->{DataTable}->{Font}->{Size} = 3;

And,

  $chart->(Legend)->{Font}->{Size} = 3;

Should be:

  $chart->{Legend}->{Font}->{Size} = 3;

Don't have excel to test that Legend and Datatable are objects of a chart (and if they are whether they have a font object with a size property), but assuming that the following would work in vba:

  chart.Legend.Font.Size = 3

and

  chart.Datatable.Font.Size = 3

then the above bracketed version should work in perl.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
josgoodAuthor Commented:
Thank you!

That is exactly the answer I needed.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Perl

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.