use Win32::OLE::Variant;
use Win32::OLE qw(in with);
use Win32::OLE::Const "Microsoft Excel";
use strict;
my $excel = Win32::OLE->GetActiveObject('Excel.Application')||die "no";
$excel -> Windows("SummarySheet.xls") -> Activate;
my $workbook = $excel -> Activewindow;
my $sheet = $workbook -> Activesheet;
$sheet -> Cells(1,1) -> {Value} = "This works fine.";
####
use Win32::OLE::Variant;
use Win32::OLE qw(in with);
use Win32::OLE::Const "Microsoft Excel";
use strict;
my $excel = Win32::OLE->GetActiveObject('Excel.Application')||die "no";
$excel -> Windows("SummarySheet.xls") -> Activate;
my $workbook = $excel -> Activewindow;
my $sheet = $workbook -> Sheets(2);
$sheet -> Cells(1,1) -> {Value} = "This does not work fine.";
####
my $excel = Win32::OLE->GetActiveObject('Excel.Application')||die "couldnt get active one";
my $workbook = $excel -> Workbooks -> Add;
$workbook->Activate;
my $sheet = $workbook -> Sheets(2);
$sheet -> Cells(1,1) -> {Value} = "This works well";