Have you enabled the OA in the server? Please check this via sp_configure:
sp_configure 'show advanced options',1
GO
reconfigure
GO
sp_configure 'Ole Automation Procedures'
You should see the run_value as 1. If not - set it to 1 and check the code one more time
Kindest Regards,
Damian Widera
SQL Server MVP,
MCT, MCSE Data Platform, MCSD.NET