I try to open word like following:
Word.Application app = new Word.Application();
app.Visible = true;
Console.WriteLine($"Visible {app.Visible}");
When running this code on my development machine (Windows 10, Office 365), Word appears (as expected) and output is:
Visible: true
When running this code on the production machine (Windows Server 2019, Word 2019), Word does not appear and output is:
Visible: false
There must be some issue on the production machine as everything went well until a week ago.
Windows event log doesn't show anything that points to this issue. Re-installing Word didn't help. When starting Word manually, it starts normal and appears as expected.
Does anybody know how to investigate further or what the cause of this issue could be?
EDIT Whey I modify the code like this:
Word.Application app = new Word.Application();
app.Visible = true;
app.Activate(); // System.Runtime.InteropServices.COMException
... I get an Exception:
Anwendung kann nicht aktiviert werden. HRESULT:0x800A11F9
I found the following article COM Exception 0x800A11F9 - Cannot activate application but this doesn't provide a solution. HRESULT:0x800A11F9
I run the application as administrator.
@
symbol, otherwise no one will see that you've answered in comments. I was curious what the answer was, so only just saw your comment ^^ – Cindy Meister