Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: is this file open?

by nikosv (Hermit)
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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (12)
As of 2014-08-29 14:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (280 votes), past polls