Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: https://metacpan.org/pod/OpenOffice::OODoc

14 views
Skip to first unread message

Mike

unread,
Jan 25, 2024, 9:45:07 PMJan 25
to listas.correo via beginners, hw

It can be done with a Perl module:
https://unix.stackexchange.com/questions/723650/editing-libreoffice-calc-spreadsheets-in-the-terminal

I have not tested that.


Mike


On 1/25/24 13:05, hw wrote:
> Hi,
>
> is there a way to create libreoffice spreadsheets (ods) similar to
> Excel::Writer::XLSX?
>
> There is OpenOffice::OODoc and I don't see how to create spreadsheet
> documents with that.
>
> Is there still no way to do that?
>
>

Jim Gibson via beginners

unread,
Jan 28, 2024, 3:30:06 PMJan 28
to Perl Beginners, hw
Check out the OpenOffice::OODoc module on CPAN:
<https://metacpan.org/pod/OpenOffice::OODoc::Intro>

The documentation is a little sparse, especially with regard to “spreadsheet” mode, and I don’t have Libre Office on my system to test it out, but the following code produces an ods file that can be opened by Microsoft Excel with the expected content on my Mac Pro running perl version 5.34.3:

#!/opt/local/bin/perl
use strict;
use warnings;

use OpenOffice::OODoc;

my $spreadsheet = odfDocument(
file => "spreadsheet.ods",
create => "spreadsheet",
);

$spreadsheet->appendTable("MyTable",6,4);
$spreadsheet->cellValue("MyTable",2,1,"New value");
$spreadsheet->save();



> On Jan 28, 2024, at 8:08 AM, hw <h...@adminart.net> wrote:
>
> On Thu, 2024-01-25 at 20:28 -0600, Mike wrote:
>> It can be done with a Perl module:
>> https://unix.stackexchange.com/questions/723650/editing-libreoffice-calc-spreadsheets-in-the-terminal
>>
>> I have not tested that.
>
> I do not want to edit spreadsheets in a terminal. There's some other
> software for that.
>
> I'm looking for something similar to Excel::Writer::XLSX, mainly to
> automatically export database tables to spreadsheets from perl
> programs in ods format rather than in xlsx format.
>
>
> --
> To unsubscribe, e-mail: beginners-...@perl.org
> For additional commands, e-mail: beginne...@perl.org
> http://learn.perl.org/
>
>

Jim Gibson
j...@gibson.org



Mike

unread,
Jan 30, 2024, 10:00:08 PMJan 30
to begi...@perl.org, hw

FWIW, in Spreadsheet::WriteExcel I do this:

$sheet = $book1 -> worksheets(2) -> {Name};
$sheet = $book1 -> worksheets($sheet);
$sheet -> Activate;

$sheet -> Range("B2") -> Activate;
$ex -> ActiveWindow -> {FreezePanes} = "True";


Mike


On 1/28/24 16:26, hw wrote:
> So how do I freeze rows/columns?

Mike

unread,
Feb 9, 2024, 11:45:06 AMFeb 9
to begi...@perl.org

I don't.


Mike


On 1/31/24 16:51, hw wrote:
> Ok and how do you do it with OpenOffice::OODoc?
>


0 new messages