Help for this page

Select Code to Download


  1. or download this
    use Win32::OLE::Variant;
    use Win32::OLE qw(in with);
    use Win32::OLE::Const "Microsoft Excel";
    ...
        my $workbook = $excel    -> Activewindow;
        my $sheet    = $workbook -> Activesheet;
        $sheet -> Cells(1,1) -> {Value} = "This works fine.";
    
  2. or download this
    use Win32::OLE::Variant;
    use Win32::OLE qw(in with);
    use Win32::OLE::Const "Microsoft Excel";
    ...
        my $workbook = $excel    -> Activewindow;
        my $sheet    = $workbook -> Sheets(2);
        $sheet -> Cells(1,1) -> {Value} = "This does not work fine.";
    
  3. or download this
    my $excel = Win32::OLE->GetActiveObject('Excel.Application')||die "cou
    +ldnt get active one";
         my $workbook = $excel    -> Workbooks -> Add;
         $workbook->Activate;
        my $sheet    = $workbook -> Sheets(2);
        $sheet -> Cells(1,1) -> {Value} = "This works well";