use Win32::OLE qw(in with); my ($ex, $book, %WS); my $Exname="$ENV{USERPROFILE}\\Documents\\ABC.xls"; # Always use a new instance of Excel so as to not interfere with anything open on the desktop $ex = Win32::OLE->new('Excel.Application', sub {$_[0]->Quit;}) or die "Oops, cannot start Excel"; # Set Application Visibility; 0 = Not Visible, 1 = Visible $ex->{'Visible'} = 0; # 'Not Visible' is the default, but set it anyway $ex->{DisplayAlerts}=0; $book = $ex->Workbooks->Open($Exname); $WS{$book->Worksheets(1)->{name}}=$book->Worksheets(1); ############################# # # # Work happens here # # # ############################# $book->Close; Win32::OLE->Uninitialize; undef $book; undef $ex; #### use constant xlMinimized => -4140; $ex->{'WindowState'} = xlMinimized; # the window will be momentarily visible anyway