Win32::OLE, Excel, and coloring

M

M. David Allen

Hello,

I've been using ActiveState's ActivePerl to generate Excel
spreadsheets using the Win32::OLE module. The rudimentary examples
that are out there on the web show the way to set up specific ranges
and enter data into cells, but what I'm looking for at this point is
how to set the background color of cells.

Does anybody know how to do this with Win32::OLE? If this module maps
to Microsoft's API, is there any complete documentation out there
about which hash keys inside of range or cell objects map to which
features in the application?

Any help would be appreciated.
 
J

Jay Tilton

(e-mail address removed) (M. David Allen) wrote:

: I've been using ActiveState's ActivePerl to generate Excel
: spreadsheets using the Win32::OLE module. The rudimentary examples
: that are out there on the web show the way to set up specific ranges
: and enter data into cells, but what I'm looking for at this point is
: how to set the background color of cells.
:
: Does anybody know how to do this with Win32::OLE?

# $range is a Range object within a Worksheet object
$range->Interior->{ColorIndex} = 6; # 6 == yellow

: If this module maps to Microsoft's API,

The application's class is the interface. Win32::OLE just gives Perl
access to the class.

: is there any complete documentation out there
: about which hash keys inside of range or cell objects map to which
: features in the application?

Objects, their methods, and their properties are described in the
Excel VBA documentation. All you have to do is mentally alter VBA
syntax into Perl syntax--the Synopsis section of the Win32::OLE pod
gives good clues on that.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top