in reply to Excel::SpreadSheet : Can't call method "set_column" on an undefined value


The error comes from the fact that you haven't called add_worksheet() before trying to access the worksheet object.

Spreadsheet::WriteExcel creates a new file. It doesn't update existing files like you are trying to do in your example.

I thought that it would be possible to access the Spreadsheet::WriteExcel object that Spreadsheet::WriteExcel::FromDB uses but the module doesn't expose it.

It would be possible to subclass Spreadsheet::WriteExcel::FromDB and add the required functionality but it would probably just be easier to use DBI and Spreadsheet::WriteExcel directly.

--
John.

  • Comment on Re: Excel::SpreadSheet : Can't call method "set_column" on an undefined value