Win32::OLE, Excel, and coloring

Discussion in 'Perl' started by M. David Allen, Jun 24, 2003.

  1. 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.
     
    M. David Allen, Jun 24, 2003
    #1
    1. Advertising

  2. M. David Allen

    Jay Tilton Guest

    (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.
     
    Jay Tilton, Jun 25, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. M. David Allen

    Win32::OLE, Excel, and coloring

    M. David Allen, Jun 24, 2003, in forum: Perl Misc
    Replies:
    1
    Views:
    203
    Jay Tilton
    Jun 25, 2003
  2. Richard S Beckett

    Win32-OLE, excel, and empties.

    Richard S Beckett, Jul 11, 2003, in forum: Perl Misc
    Replies:
    1
    Views:
    268
    Jay Tilton
    Jul 11, 2003
  3. Lance Hoffmeyer
    Replies:
    0
    Views:
    275
    Lance Hoffmeyer
    Nov 17, 2003
  4. Domenico Discepola

    Win32::OLE and creation of pivot table in Excel

    Domenico Discepola, Dec 3, 2003, in forum: Perl Misc
    Replies:
    4
    Views:
    624
    Domenico Discepola
    Dec 4, 2003
  5. Replies:
    1
    Views:
    909
Loading...

Share This Page