Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

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().

Comment on Re: is this file open?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://946648]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (7)
As of 2015-11-29 16:17 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (751 votes), past polls