Built-in office application. How to find out if an application is running or if an object is embedded.

I am adding an Excel Worksheet object inside Word. Excel has an added COM addon. Any idea how you can find out if Excel works independently or as an embedded object?

The COM addon attached to Excel loads when the built-in Excel object is activated (double-clicked) inside Word. I am looking for some property or parameter in OnConnection (...) or another method that can determine the state of an Excel object.

+4
source share
1 answer

Try the UserControl property of the Application object.

UserControl property . True if the application is visible or it was created or launched by the user. False if you created or launched applications programmatically 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'm not sure if this will help in your particular case.

+3
source

Source: https://habr.com/ru/post/1312826/


All Articles