in reply to Re: open workbook-WriteExcel
in thread open workbook-WriteExcel
you can use Win32::OLE to create that object. Below is a tested and verified example of how to add a sheet. If you want it to be named something specific you must later change the name property, as the worksheet cannot be named when it is first created.
#!/perl -w use strict; use Win32::OLE; my $path = "C:\\TEST_EXCEL"; my $excel = new Win32::OLE('Excel.Application'); my $workbook = $excel->Workbooks->Open($path."\\Book1.xls"); $workbook->Worksheets->Add(); $workbook->Save(); $excel->Quit();
|
|---|