Win32::OLE, Excel, and coloring

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • M. David Allen

    Win32::OLE, Excel, and coloring

    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.
  • Jay Tilton

    #2
    Re: Win32::OLE, Excel, and coloring

    mda@idatar.com (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.

    Comment

    Working...