C# - word interop throw “System.Runtime.InteropServices.COMException (0x800A13E9): Word has encountered a problem.”
up vote
0
down vote
favorite
When I try to open a Word file using Interop it will be applied to the System.Runtime.InteropServices.COMException error (0x800A13E9): Word has encountered a problem.
code:
Word.Application app = new Word.Application();
app.Visible = true;
var doc = app.Documents.Open(@"C:Temptest.docx");
//..... do something
doc.Close(false);
app.Quit();
The fall is on the "app.Documents.Open()" function.
I tried to add Desktop Folder in "C:WindowsSysWOW64configsystemprofile" , update in registery and in Component Services but it does not help.
The same code works on win7 computer but does not work on win10.
And when I try to open Excel file via interop it is opened correctly with the same settings.
I would be happy to help,
thank you
c# ms-word office-interop
add a comment |
up vote
0
down vote
favorite
When I try to open a Word file using Interop it will be applied to the System.Runtime.InteropServices.COMException error (0x800A13E9): Word has encountered a problem.
code:
Word.Application app = new Word.Application();
app.Visible = true;
var doc = app.Documents.Open(@"C:Temptest.docx");
//..... do something
doc.Close(false);
app.Quit();
The fall is on the "app.Documents.Open()" function.
I tried to add Desktop Folder in "C:WindowsSysWOW64configsystemprofile" , update in registery and in Component Services but it does not help.
The same code works on win7 computer but does not work on win10.
And when I try to open Excel file via interop it is opened correctly with the same settings.
I would be happy to help,
thank you
c# ms-word office-interop
you need to make sure you use the correct version of the primary interop assemblies (PIA) for your OS and Office versions: docs.microsoft.com/en-us/visualstudio/vsto/… apart from that, it would help if you could include relevant parts of your code and version informations of the components involved.
– dlatikay
Nov 11 at 12:00
0x800A makes it an application-specific error, convert 0x13E9 to find the right google query "microsoft word error 5097". Lots and lots of hits. But surely you'll discover that a snippet of the code that fails is pretty important to get help here.
– Hans Passant
Nov 11 at 12:18
Possibly, it's a permissions problem with theTemp
directory. Can you open a file from another, trusted folder? (Trusted, as in File/Options/Trust Center/Settings/Trusted Locations) Also: which version of Word is involved, here?
– Cindy Meister
Nov 11 at 16:57
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
When I try to open a Word file using Interop it will be applied to the System.Runtime.InteropServices.COMException error (0x800A13E9): Word has encountered a problem.
code:
Word.Application app = new Word.Application();
app.Visible = true;
var doc = app.Documents.Open(@"C:Temptest.docx");
//..... do something
doc.Close(false);
app.Quit();
The fall is on the "app.Documents.Open()" function.
I tried to add Desktop Folder in "C:WindowsSysWOW64configsystemprofile" , update in registery and in Component Services but it does not help.
The same code works on win7 computer but does not work on win10.
And when I try to open Excel file via interop it is opened correctly with the same settings.
I would be happy to help,
thank you
c# ms-word office-interop
When I try to open a Word file using Interop it will be applied to the System.Runtime.InteropServices.COMException error (0x800A13E9): Word has encountered a problem.
code:
Word.Application app = new Word.Application();
app.Visible = true;
var doc = app.Documents.Open(@"C:Temptest.docx");
//..... do something
doc.Close(false);
app.Quit();
The fall is on the "app.Documents.Open()" function.
I tried to add Desktop Folder in "C:WindowsSysWOW64configsystemprofile" , update in registery and in Component Services but it does not help.
The same code works on win7 computer but does not work on win10.
And when I try to open Excel file via interop it is opened correctly with the same settings.
I would be happy to help,
thank you
c# ms-word office-interop
c# ms-word office-interop
edited Nov 11 at 16:47
Cindy Meister
13.5k101934
13.5k101934
asked Nov 11 at 11:58
Shrd
114
114
you need to make sure you use the correct version of the primary interop assemblies (PIA) for your OS and Office versions: docs.microsoft.com/en-us/visualstudio/vsto/… apart from that, it would help if you could include relevant parts of your code and version informations of the components involved.
– dlatikay
Nov 11 at 12:00
0x800A makes it an application-specific error, convert 0x13E9 to find the right google query "microsoft word error 5097". Lots and lots of hits. But surely you'll discover that a snippet of the code that fails is pretty important to get help here.
– Hans Passant
Nov 11 at 12:18
Possibly, it's a permissions problem with theTemp
directory. Can you open a file from another, trusted folder? (Trusted, as in File/Options/Trust Center/Settings/Trusted Locations) Also: which version of Word is involved, here?
– Cindy Meister
Nov 11 at 16:57
add a comment |
you need to make sure you use the correct version of the primary interop assemblies (PIA) for your OS and Office versions: docs.microsoft.com/en-us/visualstudio/vsto/… apart from that, it would help if you could include relevant parts of your code and version informations of the components involved.
– dlatikay
Nov 11 at 12:00
0x800A makes it an application-specific error, convert 0x13E9 to find the right google query "microsoft word error 5097". Lots and lots of hits. But surely you'll discover that a snippet of the code that fails is pretty important to get help here.
– Hans Passant
Nov 11 at 12:18
Possibly, it's a permissions problem with theTemp
directory. Can you open a file from another, trusted folder? (Trusted, as in File/Options/Trust Center/Settings/Trusted Locations) Also: which version of Word is involved, here?
– Cindy Meister
Nov 11 at 16:57
you need to make sure you use the correct version of the primary interop assemblies (PIA) for your OS and Office versions: docs.microsoft.com/en-us/visualstudio/vsto/… apart from that, it would help if you could include relevant parts of your code and version informations of the components involved.
– dlatikay
Nov 11 at 12:00
you need to make sure you use the correct version of the primary interop assemblies (PIA) for your OS and Office versions: docs.microsoft.com/en-us/visualstudio/vsto/… apart from that, it would help if you could include relevant parts of your code and version informations of the components involved.
– dlatikay
Nov 11 at 12:00
0x800A makes it an application-specific error, convert 0x13E9 to find the right google query "microsoft word error 5097". Lots and lots of hits. But surely you'll discover that a snippet of the code that fails is pretty important to get help here.
– Hans Passant
Nov 11 at 12:18
0x800A makes it an application-specific error, convert 0x13E9 to find the right google query "microsoft word error 5097". Lots and lots of hits. But surely you'll discover that a snippet of the code that fails is pretty important to get help here.
– Hans Passant
Nov 11 at 12:18
Possibly, it's a permissions problem with the
Temp
directory. Can you open a file from another, trusted folder? (Trusted, as in File/Options/Trust Center/Settings/Trusted Locations) Also: which version of Word is involved, here?– Cindy Meister
Nov 11 at 16:57
Possibly, it's a permissions problem with the
Temp
directory. Can you open a file from another, trusted folder? (Trusted, as in File/Options/Trust Center/Settings/Trusted Locations) Also: which version of Word is involved, here?– Cindy Meister
Nov 11 at 16:57
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53248502%2fc-sharp-word-interop-throw-system-runtime-interopservices-comexception-0x800%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
you need to make sure you use the correct version of the primary interop assemblies (PIA) for your OS and Office versions: docs.microsoft.com/en-us/visualstudio/vsto/… apart from that, it would help if you could include relevant parts of your code and version informations of the components involved.
– dlatikay
Nov 11 at 12:00
0x800A makes it an application-specific error, convert 0x13E9 to find the right google query "microsoft word error 5097". Lots and lots of hits. But surely you'll discover that a snippet of the code that fails is pretty important to get help here.
– Hans Passant
Nov 11 at 12:18
Possibly, it's a permissions problem with the
Temp
directory. Can you open a file from another, trusted folder? (Trusted, as in File/Options/Trust Center/Settings/Trusted Locations) Also: which version of Word is involved, here?– Cindy Meister
Nov 11 at 16:57