Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

References and/or CreateObject - Please Help Me 1

Status
Not open for further replies.

Internetmanager

Technical User
Sep 9, 2005
3
FI
I need to control Word from Access.
I have tried to use it with
Set wdApp = CreateObject("Word.Application")
but this way I couldn't use the constants of Word (like: wdPrintView).

So I have selected "Microsoft Word 11.0 Object Library" from the Preferences list.

But this didn't work too. So I have tried to use them together.

I mean that I have initialised the server with the CreateObject and later I use this instance by simply Word.ActiveDocument...

And at the end of my program I use
Word.Application.Quit
Set wdApp = Nothing

And it works. But when I want to run it twice, I got this errormessage:
The remote server machine does not exist or is unavailable (Error 462)

Why? What did I wrong?
 
Hi Internetmanager,

This is probably because you have implicitly instantiated something. Make sure ALL references to ALL Word objects are properly qualified.

Having said that, this rings a bell - might be worth a search on MSDN.

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
Excel VBA Training and more Help at VBAExpress[
 
Could you give me a link?
Or could you tell me how should I use it?

If I use the Reference (you know I have marked the checkbox) should I initialise it from my macro?

I always have problems to find the information I need on the MSDN. Maybe my language knowledge is not good enough.
 
Replace this:
Word.Application.Quit
By this:
wdApp.Application.Quit

In fact replace ALL occurences of Word. by wdApp. and check that ALL word thingies are fully qualified with wdApp.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top