General information
Category:
Coding, syntax & commands
>If type("ObjExcel")="O" and not isnull(ObjExcel)
>*already up
>endif
>
Actually, for Excel, that may not work correctly. Excel can stay in memory even after you shut it down. If you grab that instance again, it's only partially functional.
The only way I've found to reliably track whether an instance of Excel that I created via Automation is still available is to use an extra variable to keep track of Excel's expected visibility. If my variable and Excel's Visible property match, life is good.
Here's some code from the Automation book:
IF IsNull(This.oServer)
* No instantiated server
lReturn = .F.
ELSE
* Compare actual Visible value to tracked visibility
IF This.oServer.Visible = This.lShouldBeVisible
* They match, so the server is open and good
lReturn = .T.
ELSE
* Visibility doesn't match. User must have shut server down
lReturn = .F.
ENDIF
ENDIF
RETURN lReturn
Tamar
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only