jpjy jpjy - 4 months ago 21
Perl Question

How to print to next vertical empty cell using Excel::Writer::XLSX

I am using module

.

My program will open an Excel file like this

A B C
1 xx
2 xx
3 xx
4
5


And in the above example I want to print to A4, A5 and so on

Is this possible?

Currently I am using

$worksheet->write( "a$num", "$key" );
$num++;


but that will always start at a specified point.

Answer

You can't do that without messing with the internals of the Excel::Writer::XLSX::Worksheet object hash

But that shouldn't be a problem. The module can only create Excel files from scratch, so anything that's already in column A is something that you've written there. You just need to keep track of what data has been added