I am new to perl programming, i stcked at one line.
I have written code such that new excel sheet will save accordingly even though if already existed Excel sheet persists.
The problem is if my new excel sheet has more number of sheets/charts it is not saving properly and it is getting handle to the already existed Excel sheet.
If my new excel sheet has only 1 sheet in side it is saving properly.
Expand|Select|Wrap|Line Numbers
- my $Excel = Win32::OLE->GetActiveObject('Excel.Application');
- if(defined $Excel){
- my $index = $Excel->Workbooks->Count ;
- my $HandleWorkbook = $Excel->Workbooks($index);
Please help me in this.
here $index is 2 when new excel sheet(book1) has one sheet in side.
$index is 1 when new excel sheet(book1) has more sheets inside, so it is getting handle to the already opened excel sheet.