Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Re: is this file open?

by nikosv (Chaplain)
on Jan 06, 2012 at 18:43 UTC ( #946648=note: print w/replies, xml ) Need Help??

in reply to is this file open?

Take a look at the Win32::OLE documentation which can tell you if Excel (OLE automation server) or the object is already open:

Win32::OLE->GetActiveObject(CLASS, DESTRUCTOR) The GetActiveObject() class method returns an OLE reference to a running instance of the specified OLE automation server. It returns undef if the server is not currently active. It will croak if the class is not even registered. The optional DESTRUCTOR method takes either a method name or a code reference. It is executed when the last reference to this object goes away. It is generally considered impolite to stop applications that you did not start yourself.

Win32::OLE->GetObject(MONIKER, DESTRUCTOR) The GetObject() class method returns an OLE reference to the specified object. The object is specified by a pathname optionally followed by additional item subcomponent separated by exclamation marks '!'. The optional DESTRUCTOR argument has the same semantics as the DESTRUCTOR in new() or GetActiveObject().

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://946648]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2018-06-23 18:51 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (125 votes). Check out past polls.