Run Time Error 462

D

Dave C

I have a button that opens Word and then displays the file open dialog box.

The code I'm using is:

Dim oApp as Object
Set oApp = CreateObject("Word.Application")
oApp.Visible = True
Dialogs(wdDialogFileOpen).Show

This works fine the first time it's run but after Word is closed and the
button is clicked again Word opens and I get the following error message:

"Run Time Error 462"
"The remote server machine does not exist or is unavailable"

I would be grateful for any suggestions as to why this is happening and
moreso for a solution to the problem.

Thanks in advance

Dave
 
6

'69 Camaro

Hi, Dave.

The code you posted doesn't show the entire procedure (or maybe it _is_ the
entire procedure, and that's the problem), but is your procedure quitting
the Word application (this can be done manually), closing oApp, and then
setting oApp to Nothing?

Not doing these things can prevent the system resources used for the OLE
server (Word application) from being released, and therefore unavailable the
next time the OLE server is needed in the code.

HTH.

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address, so that a message
will be forwarded to me.)
 
D

Dave C

Hello Gunny

Thanks for the response. One more question - want code do I need to close oApp
and then to set it to nothing?

Regards,

Dave
 

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