http://www.perlmonks.org?node_id=1015863


in reply to Adding new workbook to existing excel

If you are in a Windows environment, you could use Win32::OLE to work with Excel. Adding a new worksheet can be done like this:

#___ ADD NEW WORKSHEET $workbook -> Worksheets -> Add({After => $workbook -> Worksheets($work +book -> Worksheets -> {Count})});
note: The line above has been taken from this great example, which you surely want to check out.

HTH, Rata

Replies are listed 'Best First'.
Re^2: Adding new worksheet to existing Excel workbook
by sundialsvc4 (Abbot) on Jan 29, 2013 at 13:30 UTC

    I definitely concur with this.   Fire up the Excel application in this manner, and tell it what you want it to do.

    It took Microsoft a bunch of years to finally get OLE “really right,” and for computers to grow-up enough to easily handle it ... but ... they did and they did.   Do it that way.