Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / November 2006

Tip: Looking for answers? Try searching our database.

VBA Runtime error 462

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Newbie - 02 Nov 2006 12:20 GMT
Hello,
I have 2 VBA procedures which create a Word document from 2 different
templates : Model1 or Model2, stored in the same directory:
Set wrdDoc = Documents.Add(Template:="\\Server\Mes documents
SVR\Pilotage\Model1.dot", Visible:=False)
The 2 procedures ran many times without any problem, but today one of them
generates the error message:

"Runtime error '462'. The remote server doesn't exist or is not available."
What could be the cause of this error?
Thanks for your help!

Newbie
Jezebel - 03 Nov 2006 04:14 GMT
It means just what it says. Your computer can't connect to \\Server\...

> Hello,
> I have 2 VBA procedures which create a Word document from 2 different
[quoted text clipped - 10 lines]
>
> Newbie
Newbie - 03 Nov 2006 10:54 GMT
Jezebel,

False : another procedure using the same syntax connects perfectly onto the
same server, on the same directory...

> It means just what it says. Your computer can't connect to \\Server\...
>
[quoted text clipped - 12 lines]
> >
> > Newbie
Cindy M. - 07 Nov 2006 13:48 GMT
Hi Newbie,

> I have 2 VBA procedures which create a Word document from 2 different
> templates : Model1 or Model2, stored in the same directory:
[quoted text clipped - 5 lines]
> "Runtime error '462'. The remote server doesn't exist or is not available."
> What could be the cause of this error?

Often, this error means that a document variable you instantiated, to hold an
object, hasn't been released. Since it hasn't been released, when the VBA
code runs again, it can't re-use the object. Most often, this happens with an
object variable to which the application you're remoting is assigned.
Example:

   Dim wdApp as Word.Application
   Set wdApp = New Word.Application
   'do things
End Sub

You'll notice that, in this code snippet you don't see
   Set wdApp = Nothing

So the next time the code runs, there's a good chance the code will fail at
Set wdapp = New Word.Application.

Note that ANY "orphaned" pointer to an object could be causing the problem.
It could, for example, be wrdDoc in your code.

The next time you see the error, try closing the application in which your
code is running, then start it again. I'm betting the code will run the first
time after you re-start the application. Then you need to track down under
what particular set of circumstances this happens, follow that code branch,
and discover where the objects aren't being correctly released.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)
Newbie - 08 Nov 2006 22:56 GMT
Thanks a lot Cindy,
I'll work around that.

Newbie

> Hi Newbie,
>
[quoted text clipped - 41 lines]
> This reply is posted in the Newsgroup; please post any follow question or
> reply in the newsgroup and not by e-mail :-)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.