views:

22

answers:

1

I am adding an Excel Worksheet object inside Word. Excel has a COM addin attached to it. Any idea how one can know whether Excel is running independently or as an embedded object?

The COM Addin attached to Excel loads when the embedded Excel object is activated (double-clicked) inside Word. I am looking for some kind of a property or a parameter in OnConnection(...) or other method that can tell the state of Excel object.

+1  A: 

Try the UserControl property of the Application object.

UserControl Property True if the application is visible or if it was created or started by the user. False if you created or started the application programmatically by using the CreateObject or GetObject functions, and the application is hidden. Read/write Boolean.

It has been a long time since I had to use this property, so I am not sure it will help in your specific case.

AMissico
Thanks AMissico!!
A9S6
@A9S6: You are welcome.
AMissico