PC Review


Reply
Thread Tools Rate Thread

Converting Macro to Perl - charting help

 
 
dravon
Guest
Posts: n/a
 
      6th May 2006
I have a functioning macro which selects a chartobject, modifies the
various values, and moves to the next chartobject. I'm trying to
convert this macro to perl but am not having any luck. I can get the
perl script to select the chartobject, but from there it can't seem to
associate the modified values with the chartobject which has been
activated. Any suggestions??

$Excel->Sheets('Charts')->ChartObjects('Chart 1')->Activate();
my $Chart = $Excel->Charts->Open->ChartObjects('Chart 1');
$Chart->ChartArea->Select();
$Chart->SeriesCollection(1)->{Values} = '';
$Chart->{HasTitle} = 1;
$Chart->ChartTitle->Characters->{Text} = '';
$Chart->ApplyDataLabels->{ShowValue};
$Chart->SeriesCollection(1)->Border->{LineStyle} = xlNone;
$Chart->SeriesCollection(1)->Interior->{ColorIndex} = 39;
$Chart->SeriesCollection(1)->DataLabels->Font->{Size} = 8;
$Excel->Sheets('Charts')->ChartObjects('Chart 2)->Activate();
my $Chart = $Excel->Charts->Open->ChartObjects('Chart 2');
(etc)

It's that my $Chart line which constantly blows up - all the other
lines work if I'm trying to create a new chart. The line from the
functioning version of this full script is "my $Chart =
$Excel->Charts->Add;" ... but now I want to edit or open or modify an
existing chart object, not add a new chart.

I've tried probably 150 permutations of this one line, but since I'm
not a real perl programmer, I'm just doing this by the "hunt and peck"
method of testing various values to see if anything works. Any
suggestions for this programming-challenged brain?

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Please help converting the following perl script into C#, vb.net or ASP.NET barshad@gmail.com Microsoft C# .NET 0 6th May 2007 10:03 AM
loading a macro programmatically in excel VBA or perl surf Microsoft Excel Programming 0 22nd Mar 2006 11:10 PM
Charting Items in H:MM:SS format and/or converting H:MM:SS to all =?Utf-8?B?bWVh?= Microsoft Excel Charting 1 18th Aug 2004 11:56 PM
Excel 2000 Macro and Perl problem Jim Simpson Microsoft Excel Programming 0 19th May 2004 06:45 PM
Embed Perl or execute perl script Kai Thorsrud Microsoft VB .NET 2 5th Jan 2004 10:30 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:51 AM.