Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Using Win32::OLE and Excel - Tips and Tricks

by Anonymous Monk
on Jan 14, 2003 at 18:23 UTC ( [id://226917]=note: print w/replies, xml ) Need Help??


in reply to Using Win32::OLE and Excel - Tips and Tricks

Hi cacharbe,
I'm trying to fill up an excel sheet following a format wich is stored in an excel template (just in a regular excel file).
This tutorial is really help me, but there's still something hard to do : find out wich cells are merged in the template and merging the matching cells in the output file.
I have found the MergeCells property, a boolean that tells you if there are a merged cell in the parent object. MergeArea returns a range of merged cells containing a given cell. My problem is I cant find a way to extract the row & col indexes to reproduce the merge on the output file.
Any idea about, it.
mehdi aziz
mehdiaziz@lycos.com
  • Comment on Re: Using Win32::OLE and Excel - Tips and Tricks

Replies are listed 'Best First'.
Re^2: Using Win32::OLE and Excel - Tips and Tricks
by Anonymous Monk on Sep 20, 2004 at 12:24 UTC
    I have a problem with this:

    my $indents = $Sheet->Range( "A1:B2" )->{'IndentLevel'};

    If i use 'Value' in stead of IndentLevel everything works fine.

    Any ansers?
Re: Re: Using Win32::OLE and Excel - Tips and Tricks
by Anonymous Monk on May 03, 2004 at 11:03 UTC
    Hi aziz, Sorry that I am asking you a question instead of an answer.Can u give me the syntax to merge cells in excel using perl(with OLEs)? Thanks, Sree
      I know how to read an Excel cell's hyperlink value. What is the syntax to set or change a cell's hyperlink value? -docuSwear

        Here is a short example:
        #!/usr/bin/perl -w use strict; use Cwd; use Win32::OLE; use Win32::OLE::Const 'Microsoft Excel'; my $application = Win32::OLE->new("Excel.Application"); my $workbook = $application->Workbooks->Add; my $worksheet = $workbook->Worksheets(1); # Write a hyperlink my $range = $worksheet->Range("B2:B2"); $worksheet->Hyperlinks->Add({Anchor => $range, Address => "http://www.perl.com/"}); # Get current directory using Cwd.pm $workbook->SaveAs({FileName => cwd() . '/win32ole.xls'}); $workbook->Close; __END__

        --
        John.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2024-04-19 07:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found