http://qs1969.pair.com?node_id=1056298


in reply to Re^2: Not able to create worksheets inside a subroutine
in thread Not able to create worksheets inside a subroutine

Spreadsheet::WriteExcel tries to close your workbook automatically but sometimes has problems "If the new(), add_worksheet() or add_format() methods are called in subroutines." You can read the section on the close() method for more detail on limitations of automatic closing.