Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Using Spreadsheets from MS Office alternatives

by merrymonk (Hermit)
on Nov 03, 2020 at 11:31 UTC ( [id://11123364]=perlquestion: print w/replies, xml ) Need Help??

merrymonk has asked for the wisdom of the Perl Monks concerning the following question:

I have Perl applications which read and write to spreadsheets. I am using MS Office 2010 to write spreadsheets which are read by the applications.

I use the following Win32 modules:

use Win32; use Win32::OLE; use Win32::OLE::Const "Microsoft Excel .* Object Library";
Office 10 support ended last month (October). I think that Office was automatically updated at the end of October. When I try and start either Excel or Word I am getting messages like "Error 1706. Setup cannot find the required files" but it they will run when I use a Cancel option a number of times. I am not confident that if I solve this particular problem I will be able to do so if more arise in the future.

Rather than buying one of the versions of Office I am looking at the free alternatives such as LibreOffice. My initial tests seem to show that this can read and write .xls and .xlsx formatted spreadsheets.

Some questions:

Q1. If I use LibraOffice can I still use the Win modules listed above? If so is this likely to remain the case for at least a few years?

Q2. Are there any particular hidden traps that I should be aware of?

Replies are listed 'Best First'.
Re: Using Spreadsheets from MS Office alternatives
by marto (Cardinal) on Nov 03, 2020 at 12:14 UTC

    Can't you just use perl and something like Excel::Writer::XLSX (N.B. the 'reading Excel files' section of the docs)? The error listed above is usually to do with paths to installation media. Alternatively see OpenOffice::UNO or other alternative for open/libreoffice automation.

    Update: Fixed typo.

Re: Using Spreadsheets from MS Office alternatives
by Corion (Patriarch) on Nov 03, 2020 at 11:54 UTC

    No - LibreOffice does not have the same OLE automation like MS Office has.

    LibreOffice can be automated using other OLE/COM automation calls, but it means you will have to rewrite all your automation macros.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://11123364]
Approved by marto
Front-paged by davies
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: (3)
As of 2024-04-25 16:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found