Skip to main content

Call COM method

Create a COM object by its ProgID and call a method or read or set a property (Windows), optionally through a path of properties.

Command in the .NET, Java and COM toolkit · id ooa.dotnet/call_com_method · 8 inputs (2 required), 3 outputs

Inputs​

InputTypeRequiredDefaultWhat it is
Prog IDStringYesProgID of the COM class.
PathListNoProperties to go through first, in order, e.g. Workbooks then Item.
MemberStringYesMethod or property name.
KindStringNomethodCall a method, read a property, or set one (its value is the last argument).
ArgumentsListNoArguments in order.
QuitBooleanNofalseCall the object's Quit method at the end (Office applications).
Timeout (seconds)NumberNo120Stop the call after this many seconds.
Fail on errorBooleanNotrueFail the step when the code throws; when off, the error goes to 'error' and the run goes on.

Outputs​

OutputTypeWhat it is
resultAnyWhat the method or property returned (objects as text).
outputStringAnything written to the console.
errorStringThe error, when fail on error is off.