Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Win32::OLE Excel and setting the X axis names

by Cycle Boy (Initiate)
on May 02, 2002 at 12:03 UTC ( [id://163509]=perlquestion: print w/replies, xml ) Need Help??

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

Hi,

I have a simple two column spreadsheet.

Column A contains names, and B counts of the names.

How can I sprinkle column A's names along the X axis of my chart (instead of getting 1,2,3 etc)?

I've read all the documentation I can find on this but I'm stuck!

My efforts so far...

use Win32::OLE etc $axisrange="a1:a$i"; # names $range = "b1:b$i"; # counts of names print "range $range\n"; $Sheet->Range("$range")->Select; my $Chart = $Book->Charts->Add; $Chart->{ChartType} = -4100; $Chart = $Excel->ActiveChart; $SeriesCol = $Chart->SeriesCollection->Add; $SeriesCol->{XValues} = $Sheet->Range("$axisrange"); $Chart = $Excel->ActiveChart; etc
Can anyone offer a simple example or let me know what I'm doing wrong?

Thanks,

David

Replies are listed 'Best First'.
Re: Win32::OLE Excel and setting the X axis names
by Moonie (Friar) on May 02, 2002 at 15:03 UTC
Re: Win32::OLE Excel and setting the X axis names
by dws (Chancellor) on May 02, 2002 at 16:11 UTC
    Definitely read the article that moonie suggested.

    The way I approach problems like this when I have Excel on the box (which I don't right now -- sorry) is to record a Macro in Excel, then go through the steps to create and format the chart. The resulting Macro is in Visual Basic, but it's usually possible to reverse engineer it and convert it to Perl.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://163509]
Approved by particle
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2025-06-25 04:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.