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

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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (10)
As of 2015-07-29 09:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (263 votes), past polls