Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

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

by Anonymous Monk
on Jan 14, 2003 at 18:23 UTC ( #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
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.

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?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2014-12-19 04:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (70 votes), past polls