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
Re^2: Adding new worksheet to existing Excel workbook
by sundialsvc4 (Monsignor) 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 about the Monastery: (7)
As of 2014-08-28 01:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (255 votes), past polls