Word.Application ComObject errors in PowerShell


I’m unable to get a Word 2010 (14.0.x) document to SaveAs or Close using Powershell. From all the tuts online it seems like it should be working with 2.0, but I don’t have that anymore.

Simple case:

At this point everything works up until the saving and closing:

It seems like any methods that Get-Member shows as having arguments fail. For instance, calling a simple $Doc.Save() works fine, it seems. Looking at the MSDN info on those methods it looks like it takes things like the SaveChanges method, but that’s honestly beyond my skills at this point.

I’ve tried passing $Null or $True or $False in hopes of getting lucky, but it just keeps balking at me.

All I’ve been able to find is that it is apparently linked to PS 3.0 Beta (seems to work fine in 2.0 for people) and a comment Ed Wilson hasn’t gotten back to.


I was also struggling al lot with this error, but got finally around it by calling the “Value” property of the PSReference (I got my Information here: https://msdn.microsoft.com/en-us/library/system.management.automation.psreference(v=vs.85).aspx )

this finally resulted in the codeLines:


Word.Application ComObject errors in PowerShell by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply