By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,153 Members | 960 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,153 IT Pros & Developers. It's quick & easy.

C# Automation Word - Exception from HRESULT: 0x800706BE)

P: 5
Hello ! Does anyone knows how to resolve that.

I maked a simple project (Web Project) that open a document word and write some lines .

Running with Visual Studio works well , but when I make a deploy nothing happens and if I stop the process winword in the tasks I receive the next message.

If anyone knows the solution I am very thankful.

Thanks,

Valmir



Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Runtime.InteropServices.COMException: Falha na chamada de procedimento remoto. (Exception from HRESULT: 0x800706BE)

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[COMException (0x800706be): Falha na chamada de procedimento remoto. (Exception from HRESULT: 0x800706BE)]
Microsoft.Office.Interop.Word.Documents.Open(Objec t& FileName, Object& ConfirmConversions, Object& ReadOnly, Object& AddToRecentFiles, Object& PasswordDocument, Object& PasswordTemplate, Object& Revert, Object& WritePasswordDocument, Object& WritePasswordTemplate, Object& Format, Object& Encoding, Object& Visible, Object& OpenAndRepair, Object& DocumentDirection, Object& NoEncodingDialog, Object& XMLTransform) +0
automacaoWord.Open(String strFileName) +129
_Default.Button1_Click(Object sender, EventArgs e) +84
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
System.Web.UI.WebControls.Button.RaisePostBackEven t(String eventArgument) +107
System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102

--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.210

--------------------------------------------------------------------------------
Jun 10 '07 #1
Share this Question
Share on Google+
7 Replies


kenobewan
Expert 2.5K+
P: 4,871
Where did you deploy it to? Does that machine have word installed?
Jun 11 '07 #2

P: 5
I deployed in my own machine, an yes have the word installed....

I try to make a console application but I have the same problem....


Where did you deploy it to? Does that machine have word installed?
Jun 11 '07 #3

TRScheel
Expert 100+
P: 638
I deployed in my own machine, an yes have the word installed....

I try to make a console application but I have the same problem....

Let me make sure I understand this:

When debugging through VS2005, it works fine.
When ran outside and through the release deployment, it does not work?


-- SIDE NOTE --

Looking at your error message, I would guess it has something to do with an invalid filename, or accessing a filename in the wrong place.

EXAMPLE:

Your program is compiled in - c:\myprograms\testprogram
The file you want is - c:\myprograms\testprogram\files\testfile.txt

In your program somewhere you have an embedded string with the filelocation:
\files\testfile.txt

So when in debug it works fine. BUT once the program is released and moved, that location no longer points to a valid file.


Thats just my take on your error message though, because it seems to have something to do with accessing the file in question.
Jun 11 '07 #4

TRScheel
Expert 100+
P: 638
Whoa, backing up, I just reread your question.

This is a web application?

If so, it may (and probably will work) in the debug versions, but I highly doubt that it will work on any production version except those that use your site as a desktop application.
Jun 11 '07 #5

P: 5
I donīt understand why works in debug and in the production not

it would have to function........

anyway , thank you very much !!!




Whoa, backing up, I just reread your question.

This is a web application?

If so, it may (and probably will work) in the debug versions, but I highly doubt that it will work on any production version except those that use your site as a desktop application.
Jun 11 '07 #6

P: 5
Ops...yes , itīs web Application.........

I donīt understand why works in debug and in the production not

it would have to function........

anyway , thank you very much !!!
Jun 11 '07 #7

TRScheel
Expert 100+
P: 638
Ops...yes , itīs web Application.........

It will work on debug because the web app has access to your machines resources (the programs included).

It will not work on the production because without running it as a desktop app, it will not have access to those resources, on yours or anyone else's machine.
Jun 11 '07 #8

Post your reply

Sign in to post your reply or Sign up for a free account.