Error 5843 when running templates with VBA code in O2K3 on W2K3-TS

H

Hen

Hi,

We are using a set of templates in Office 2003. On normal desktops they work
fine, however when we try to use them on a windows 2003 terminal server we
receive error 5843.

When we fix the error in one place by replacing it with simalar code that
does work on terminal server. But then it jumps to the next error, and then
to the next etc.

It seems there is a fundamental difference while using VBA code on a XP
desktop compared to W2K3 terminal services. Is this correct or should both
environments work the same ??

What can we change in the W2K3 TS environment that will make it work like an
XP desktop without the 5843 errors ?

Regards,

Hen
 
D

David Horowitz

Hen,
I would say it's not something different between Terminal Services and XP
per se, but more likely an environmental difference between the two machines
you're running on.
Maybe there are different versions of Word running - you sure they're both
Word 2003? The most reliable way to track it down is to find the exact line
of code that causes this error - then you can really find out what's going
on.
There may also be differences between the installed DLL's and libraries on
the various machines, and/or template installations, or file locations...
David
 
H

Hen

Hi,

They're both word 2003. Both machines (the XP workstation and the server)
have Office 2000 installed as well. When I run the templates on word 2000
they work fine on both machines. In word 2003 they work on the XP workstation
but not on the 2003 Terminal Server

The lines of code that it is failing on are pretty basic:

first it stops with a 5843 error at:

strWordStartDir = System.ProfileString("options", "startup-path")

When I replace this line by using (for example)

strWordStartDir = Options.DefaultFilePath(wdStartupPath)

this step works. Then It stops again with a 5843 at the line:

Documents.Add Template:=strSjabloonPad & "Memo_EBM.dot", newtemplate:=False

I can see the variable 'strSjabloonPad' is filled correctly, and the new
document is created in the background from the template Specified in this
line. However the error occurs and further processing stops.

Kind Regards,

Hen
 
D

David Horowitz

Hen,
Well, the first one is probably handled, but still puzzled on the second
one.
Here's what seems to be the answer on the first one:
It's possible that the "Startup-Path" entry does not exist in the registry
on the TS machine. That yields a 5843 error on my machine.
It seems that registry key is not guaranteed to be present on all Word
installations, despite that it's given as an example in the online help for
the ProfileString function.
On my machines, I don't have that registry entry.
So, how about using DefaultFilePath instead?
The second error I'm not that clear about. Are you sure strSjabloonPad
includes a backslash at the end?
If the file is not found, on my machine, I get an error 5151, not another
5843.
David
 
H

Hen

Hi,

The Startup-Path entry in the registry does exist, so the first error
shouldn't have occurred at all.

For the second error. The path is filled in and has a backslash at the end,
so this one should not produce error 5843 either. The file is also present at
the location that is called by the function. The file specified is even
opened in the background, but still the error occurs.

Any other possibilitys why it is throwing the error ?
 

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