Error "Project or Library not found" using templates in Word 2007

F

Franz Lang

Hi!

I have two word templates with simple vba code on a server where
I have unrestricted access. In template "base.dot" there is a vba
project (named "basis") with a module "letter" with a public
function "message" which presents a message box. In the second
template "main.dot" (which is opened using the "new document"
function) I just want to call my "message" function of the first
template. So, in the second template I added a reference to the
"base.dot" template and then I can call the "message" function by
writing "letter.message".

Now, when I open the second template "main.dot" in Word 2007 I
get the error "Projekt or Library not found" and the line in the
VBA code where the "letter.message" is called is highlighted. The
references in my opinion are definitely ok, I even checked them
via VBA code.

The strange thing is that when I then close the template (but not
Word) and open the template again, it does work!

In Word 2000 and 2003 the code and the templates works fine, even
the first time.

I also found out that the code works fine with Word 2007 when the
template "main.dot" resides locally on my computer. But that is
not a solution as several people have to use this template.

Anybody any hint?

Thank you very much in advance,
Franz.
 
T

ToddC

I had the same problem when migrating from word 2000 to word 2007 a while
back. Unfortunately I don't have good news. I opened a trouble ticket with
microsoft support and here was the response....

******************************************************
"In the last week we have found why the references are not being added when
the template is on a network share. It’s been my understanding that this was
a security related design change, but in fact it’s related to how Word loads
the templates to the temporary internet folder. Then when it compares the
locations of the loaded templates and the calls for the reference it fails
when they don’t match. We’re submitting this to our developers to see if
this can be changed. Hopefully, we’ll have some feedback within the next
couple months."
******************************************************
I ended up removing the reference to the master template on the network
share and had to put the master template's code into all of the templates
that were previously calling it. Macro Organizer quickly became my best
friend.
 
F

Franz Lang

Hi ToddC,

thank you very much for response.

I was afraid that something like that might be the issue after
many efforts had failed trying to resolve the problem. Well, I
also will put the code in every used template, that seems to be
the easiest way to avoid the problem for now.

Did you get that response from Microsoft before or after the
latest service pack (2) for Office 2007 was released?

May be a third service pack (or a hotfix) will solve the problem.

Thanks for your hint,
Franz.
 
T

ToddC

I was working with SP1. SP2 was released while I were working on the
problem, but it was too late for me to retest everything under SP2, so I
stayed with SP1. I "think" that MS said that the problem still existed in
SP2.
 

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