I have issues regarding COM automation in Office 2007 (Excel,
Powerpoint, Word) on a Windows Server 2008.
This is what I do:
- Open a Powershell 2.0 with -STA option
- Create a new COM object (Word, Excel or Powerpoint)
- Load a document, then save it as PDF
- destroy COM object
- exit Powershell
There can be many Powershell instances active.
The problem: I get random exceptions, like:
- Call was rejected by callee. (Exception from HRESULT: 0x80010001
(RPC_E_CALL_REJECTED))
- RPC Server not ready
- Call was rejected by the callee
- etc.
I'm not doing multithreading, I open multiple processes in STA mode,
each with its own COM server.
What could be the cause of this behaviour? This looks like a
multithreading problem, but I don't get what would cause this.
Thankful for any help,
Michael