Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

I need to copy one sheet to another sheet automatically in one Excel file

by kalyanbhave (Initiate)
on Sep 26, 2012 at 15:32 UTC ( #995798=perlquestion: print w/ replies, xml ) Need Help??
kalyanbhave has asked for the wisdom of the Perl Monks concerning the following question:

Hi , I have a script which create an excel file with below details,but I need a idea to copy data of one sheet to another sheet with renaming the sheet name automatically

my Code
use Win32::OLE; # Start Excel and make it visible $xlApp = Win32::OLE->new('Excel.Application'); $xlApp->{Visible} = 1; # Create a new workbook $xlBook = $xlApp->Workbooks->Add; # Our data that we will add to the workbook... $mydata = [["xxx", "xxx", "xxx"]]; # Write all the data at once... $rng = $xlBook->ActiveSheet->Range("A1:C7"); $rng->{Value} = $mydata; # Create a PivotTable for the data... #$tbl = $xlBook->ActiveSheet->PivotTableWizard(1, $rng, "", "MyPivotTa +ble"); # Set pivot fields... #$tbl->AddFields("Category", "Item"); #$tbl->PivotFields("Price")->{Orientation} = 4; # 4=xlDataField # Wait for user input... print "Press <return> to continue..."; $x = <STDIN>; # Clean up $xlBook->{Saved} = 1; $xlApp->Quit; $xlBook = 0; $xlApp = 0; print "All done.";

Comment on I need to copy one sheet to another sheet automatically in one Excel file
Download Code
Replies are listed 'Best First'.
Re: I need to copy one sheet to another sheet automatically in one Excel file
by marto (Bishop) on Sep 26, 2012 at 15:41 UTC

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (12)
As of 2015-07-31 14:10 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 (278 votes), past polls