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. Advertisements

  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. Advertisements

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:
    279
    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:
    368
    Jay Tilton
    Jul 11, 2003
  3. Richard S Beckett

    Win32-OLE excel cell reference.

    Richard S Beckett, Aug 8, 2003, in forum: Perl Misc
    Replies:
    4
    Views:
    358
    Bob Walton
    Aug 12, 2003
  4. Lance Hoffmeyer
    Replies:
    0
    Views:
    537
    Lance Hoffmeyer
    Nov 17, 2003
  5. Domenico Discepola

    Win32::OLE and creation of pivot table in Excel

    Domenico Discepola, Dec 3, 2003, in forum: Perl Misc
    Replies:
    4
    Views:
    1,126
    Domenico Discepola
    Dec 4, 2003
  6. Domenico Discepola

    win32::ole and excel VBA macro conversion: SmallScroll

    Domenico Discepola, May 5, 2004, in forum: Perl Misc
    Replies:
    10
    Views:
    666
    Charlton Wilbur
    May 9, 2004
  7. Replies:
    1
    Views:
    1,300
  8. Dave

    win32::OLE::Excel and lists

    Dave, Jun 17, 2005, in forum: Perl Misc
    Replies:
    3
    Views:
    627
    A. Sinan Unur
    Jun 21, 2005
Loading...