Cannot create Word application object using remoting

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
 
G

Guest

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
 
S

Stuart Hunter

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top