use strict; use Win32::OLE; use Win32::OLE::Const("Microsoft Excel 11.0 Object Library"); # Load Excel objects my $xl = Win32::OLE->new('Excel.Application'); $xl->{Visible} = 1; my $book = $xl->Workbooks->Add; my $sheet = $book->Worksheets->Add; # Add a check box to manipulate $sheet->Shapes->AddFormControl(xlCheckBox, 0, 0, 250, 250); # Get the name of our checkbox my $chkBoxName = $sheet->Shapes(1)->Name; # Check the check box $sheet->Shapes($chkBoxName)->OLEFormat->Object->{Value} = 1; sleep 2; # Uncheck the check box $sheet->Shapes($chkBoxName)->OLEFormat->Object->{Value} = 0;