Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re: Adding new worksheet to existing Excel workbook

by Ratazong (Prior)
on Jan 29, 2013 at 11:35 UTC ( #1015863=note: print w/ replies, xml ) Need Help??

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

Comment on Re: Adding new worksheet to existing Excel workbook
Download Code
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.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1015863]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (8)
As of 2015-10-13 09:15 GMT
Find Nodes?
    Voting Booth?

    Does Humor Belong in Programming?

    Results (297 votes), past polls