Use Variables/Parameters to pass Methods or Properties in COM w/AutoHotkey

pass Methods or Properties in COMI had wanted to be able to make a function where I pass Methods or Properties in COM.  (this makes it much more flexible and eases updating / maintaining of code.)  Unfortunately it was not as straight-forward as I’d hoped.

Thankfully maestrith, Author of AutoHotkey Studio, had already solved this problem and shared the solution with me!  The code which shows how to pass Methods or Properties in COM is listed below.  While in the video I demonstrate connecting to IE and perform web scraping, the solution is equally applicable to any COM object like Excel, etc.

 

Demonstration Video to pass Methods or Properties in COM

Passing methods or properties as a variable in a COM object