Today I requested that Excel::Writer::XLSX::Workbook should provide a method "activesheet" which should return the worksheet object of the current active worksheet.
The reason for this is that you only can add formats on workbook level but you might need it when you only have the worksheet.
In my case, where I want to put database data into an excel file, I would need to pass both objects, workbook and worksheet, to my subroutines or need to create a new object or work with globals. So I thought: The workbook object already knows the current active worksheet, so why not pass only the workbook? Unfortunately it knows the active worksheet, but won't tell you (unless you access its internal data).
This is what I put now into my app to get around this dilemma:
package Excel::Writer::XLSX::Workbook; sub activesheet { my($self) = @_; return $self->{'_worksheets'}->[ $self->{'_activesheet'} ]; }
I then created a pull request for this enhancement, but the author does not want to add this method unless more people request it.
So my question is: Do you also think this method is useful? Would you mind then asking for it?
Note: I'm not complaining that he did not want to include just upon my request. I also don't want you to go and request it, just because I asked for it. Just do it if you really think it's useful. Or maybe tell me why you think it's stupid. ;) I have no problem extending Excel::Writer::XLSX::Workbook the way I do it now.
In reply to Excel::Writer::XLSX -> get the active sheet by Skeeve
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |