Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

EXCEL with PERL

by jinhuang1992 (Novice)
on Aug 12, 2004 at 15:32 UTC ( [id://382303]=perlquestion: print w/replies, xml ) Need Help??

jinhuang1992 has asked for the wisdom of the Perl Monks concerning the following question:

When a spreadsheet is open, I want to write a PERL with OLE program to close the spreadsheet automatically. Can you show me how? Thanks.

Replies are listed 'Best First'.
Re: EXCEL with PERL
by VSarkiss (Monsignor) on Aug 12, 2004 at 15:48 UTC
Re: EXCEL with PERL
by guha (Priest) on Aug 12, 2004 at 16:24 UTC

    If you don't care about saving the open spreadsheets, this snippet will brutally close down all open instances of Excel.

    #!perl -w use strict; use Win32::OLE; my $ex = Win32::OLE->GetActiveObject('Excel.Application') or die "No a +ctive objects around\n"; $ex->{DisplayAlerts} = 0; $ex->Quit;

    Another way to do it, at least on WinXP would be the system command.

    taskkill /f /im EXCEL.EXE

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://382303]
Approved by ysth
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2024-04-19 04:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found