Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: a stubborn excel file

by imrags (Monk)
on Jun 24, 2009 at 11:02 UTC ( #774345=note: print w/ replies, xml ) Need Help??


in reply to a stubborn excel file

If you are on Win32 box, i'd suggest use of "Win32::OLE"
To get you started, here's a small piece of code:

use Win32::OLE; $Excel = Win32::OLE->GetActiveObject('Excel.Application') || Win32::OL +E->new('Excel.Application'); $Excel->{'Visible'} = 1; #to make it visible #my $Book = $Excel->Workbooks->Open('E:/perl scripts/abc.xls') || die +"could not open excel file"; # open Excel file $Excel->{SheetsInNewWorkBook} = 1; $workbook = $Excel->Workbooks->Add(); $Sheet = $workbook->Worksheets(1); $Sheet->{Name} = "New WorkSheet"; $Sheet->Range("A1")->{Value}="My cell number 1"; $workbook->SaveAs({Filename =>'abc.xls', FileFormat => xlWorkbookNorm +al});
Raghu


Comment on Re: a stubborn excel file
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2015-07-04 03:22 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 (57 votes), past polls