COM automation and interop for AHK v2 — driving Excel / Word / WMI / Internet Explorer via IDispatch, COM events, ComValue / SafeArrays, and direct vtable ComCall. Use when automating another application, wiring COM events, or calling a COM interface. TRIGGER when: user says "automate Excel/Word", "COM object", "ComObject", "ComCall", "WMI query", "COM event", "IDispatch", "SafeArray", "ComValue", "VARIANT". Examples: "automate Excel from AHK", "query WMI for processes", "hook IE navigation events"
Installation
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
COM automation and interop for AHK v2 — driving Excel / Word / WMI / Internet Explorer via IDispatch, COM events, ComValue / SafeArrays, and direct vtable ComCall. Use when automating another application, wiring COM events, or calling a COM interface. TRIGGER when: user says "automate Excel/Word", "COM object", "ComObject", "ComCall", "WMI query", "COM event", "IDispatch", "SafeArray", "ComValue", "VARIANT". Examples: "automate Excel from AHK", "query WMI for processes", "hook IE navigation events"
AHK v2 COM Automation
Drive another application's object model from AHK.
How to use
Load the full reference from Modules/Module_COM.md — creation, events, ComValue, SafeArrays, vtable ComCall.
Create with ComObject("ProgID") (never the removed ComObjCreate); the wrapper auto-releases on scope exit.
For headless work set obj.Visible := false / obj.DisplayAlerts := false, and obj.Quit() apps like Excel.
For COM events, ComObjConnect(obj, sink) where the sink's method names match the event names.