---
url: >-
  /statelake/scripting-reference/functions-and-procedures/com-functions/getactiveoleobject.md
---

# GetActiveOleObject

**GetActiveOleObject** is not commonly used.

For it to work, you need to be sure that the **COM** library you are accessing is already available and instantiated.

It is easier to instantiate your own copy of the library using **CreateOleObject**.

Declaration: function GetActiveOleObject(const ClassName: string): IDispatch;

An example follows.

```pascal
procedure OnStartMapEvent(var Value:Variant);
begin
  GLOBAL1 := GetActiveOleObject(<guidornameofcomlibrary>);
end;
```
