The following isn’t using host.X() API helpers (they did not exist when this was written); instead it is using ActiveX, and it works. If I was to attempt this again, I would definitely try host.X() instead …
host.X()