Method Invocation Failed Error When Calling SaveAs() In PowerShell Script

November 11th, 2012 - Posted by Steve Marks to Web Development.

Whilst recently running Microsoft Office 2007 and attempting to convert a Word doc to a PDF via a PowerShell script, I was getting the following error returned:

Method invocation failed because [System.__ComObject] doesn't contain a method named 'SaveAS'

The Solution

The solution in my case was to install a missing add-in for Microsoft Office 2007 available at the following URL:

This add-in is required in order to save files as PDF or XPS. Once installed my script then worked without these errors.

This entry was posted on Sunday, November 11th, 2012 at 10:34 am by +Steve Marks and is filed under Web Development. You can follow any responses to this entry through the RSS 2.0 feed.

Fear not, we won't publish this

Comments (0)

No comments have been left yet. Be the first