Has anyone been able to write Perl scripts with Win32::OLE that create well formatted, non-trivial spreadsheets using OpenOffice.org or derivatives such as Lotus Symphony 3? ... or by any other means?

I have years of experience creating "all sorts" of complex MS Excel spreadsheets using ActiveState Perl, Win32::OLE and the MS Excel object model. I've been "challenged" to migrate some of this work to OpenOffice 3.x. My initial impression is that it's much more complicated with OpenOffice than with MS Excel. And even some of the basics don't seem to work... like setting the visible / hidden parameter on file open call as such... (or maybe I'm just being dense). Conversely, setting Excel to invisible is commonplace and trivial.

Anyone want to collaborate on developing and posting non-trivial Perl scripts that create and manipulate OpenOffice spreadsheets?

use strict; use warnings; use Win32::OLE; use Win32::OLE::Variant; use Win32::OLE::Const; Win32::OLE->Option(Warn => 3); # Turn on warnings for easier debugging my $objServiceManager = Win32::OLE->new("com.sun.star.ServiceManager") + || die "CreateObject: $!"; # create a new process my $desktop = $objServiceManager->createInstance("com.sun.star.frame.D +esktop"); my @propValue = (); $propValue[0] = $objServiceManager->Bridge_GetStruct("com.sun.star.bea +ns.PropertyValue"); $propValue[0]->{Name} = 'Hidden'; # This does not work! $propValue[0]->{Value} = 1; my $calc = $desktop->loadComponentfromUrl("file:///C:/My Documents/Sum +mary-20101031.ods", "MyCalc", 0, \@propValue );

In reply to OpenOffice Calc/Spreadsheets & Win32::OLE by dallen16

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.