PDA

View Full Version : Error running Word from Excel



Rejje
12-17-2010, 05:21 AM
Hi!

Strange problem follows! Sometimes, usually when I've made changes to the codes in which it's located, when running the code (runs from Excel) it stoppes with error "Runtime error no '462'. Remote server is missing or is not available" (translation from Swedish).

wrdApp.Selection.Rows.Height = CentimetersToPoints(0#)

What server? If I just quit and run it again it usually works! This is so strange to me...

What might be the problem?

Bob Phillips
12-17-2010, 06:42 AM
It sounds to me that wrdApp has got corrupted, so it doesn't point to a Word instance, or perhaps the Word instance was closed. Difficult to say without the full picture.

Rejje
12-17-2010, 08:21 AM
Might be wrdApp gets corrupted. However it's strange that it always works on the second try. Maybe if I would try add a few seconds delay right before where it crashes it might work? What do you think?

Bob Phillips
12-17-2010, 10:13 AM
As I said, it is hard to say, but you could try a wait, try DoEevents, and finally try handing the task off using OnTime.