Cannot create Word application object using remoting

  • Thread starter Thread starter Stuart Hunter
  • Start date Start date
S

Stuart Hunter

I have class that creates a word application document using the following
basic code:

Public Sub CreateDocument()

Dim app As Word.Application
app = New Word.Application

...

End Sub

This works as expected when called from a console application. However,
when the same code is called via .NET remoting, the application hangs at app
= New Word.Application. The code does not return from this line and no
exception is thrown.

There is no problem with the remoting setup as all other methods return as
expected.

Has anyone else experienced and resolved this?

Thanks,

Stuart
 
H

Can you show the code where you activating the remote object? Where is the HOST of the remote object

Sooraj P
Microsoft India Community Star
 
The activation code is not the problem as it works fine with calls to
methods that do not try to instantiate the Word document.

A VB.NET console application is acting as the remoting server (server
activation). It looks like the problem is caused by all remoting calls
being sent to background threads that are unable to launch MS Word.

I think the solution is going to be to create a Windows app instead of a
console app so that I can invoke the method of the form's UI thread.
 
Back
Top