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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Project Locked: Project is unviewable. 1

Status
Not open for further replies.

epants

Programmer
Jul 1, 2008
4
I'm trying to edit and debug macros in a template. I find if I open the template directly and open the visual basic editor I can edit the macros in the template no problem. But the moment the template is added to a word document the visual basic editor refuses me access to the macros and shows the error message, "Project Locked: Project is unviewable".

Now editing the macros is no problem if I don't add the file as a template to the document that is using it, but I can't add breakpoints or step through the code since once I add it as a template to the document I'm locked out of it.

I'm using Microsoft Office 2007 and the documents I'm editing were created with an earlier version of Office (03?). I have a friend who has Office 03 and doesn't have the problem I'm having: He is able to edit and debug the macros in the template while it is loaded as a template to a document.

Does anyone know of a workaround for this problem?
 
Hi Tony,

The macros I'm working on are contained in a Normal.dot file. This Normal.dot is used as a template for a number of documents that each have sections containing fields and checkboxes that trigger the macros.

If I open Normal.dot and open the Visual Basic Editor I can edit the macros. But when I use Normal.dot as a template in one of the documents, Visual Basic Editor locks me out of the Normal.dot project and says the Project is Unviewable.

Cheers
Richard
 
Very odd. I have never seen Normal.dot show as unviewable.

Global templates (other than Normal) are unviewable because the source code is not loaded. This is never the case with Normal, which is a kind of special hybrid. I suspect you may have some corruption somewhere - maybe in the registry Word Settings value.

That said, you refer to your Normal.dot as though it were one of several and I'm still not sure exactly what you are doing.

Enjoy,
Tony

------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.

I'm working (slowly) on my own website
 
Just a very wild guess but have you tried:

Help > Detect and Repair?

 
I too have never seen Normal as unviewable. However, if your Normal.dot has code, and the document is on another machine then of course THAT machine can not see your Normal (and its code). It would see that machine's Normal - again though, that machine's Normal should be viewable.

faq219-2884

Gerry
My paintings and sculpture
 
Tony, I'm suspecting there's some sort of corruption too. I'll try and explain things a little further. The guy I'm modifying these documents for runs a building inspection company. He has Word set up to purely to run these checklist documents so his Normal.dot file has been modified to include all the macros and formatting to run the checklists. He's given me a checklist document and I'm adding his Normal.dot file as a template to the document. It's differentiated from my Normal file which is a dotm file since I'm running Office 07.

mscallisto, I've tried the Detect and Repair and it didn't help.

fumei, I'm not accessing a Normal file on a network. It's just me on my lonesome on a laptop.

I must say thanks to everyone for their suggestions. I think I've got a bit of a unique problem here - none of my searches on any forums has come up with a similar situation. I'm almost resigned to doing things the long way - just working on the Normal file and reintroducing it as a template to the document everytime I want to test it. Still open to suggestions though!
 
Can you expand a little on "I'm adding his Normal.dot file as a template to the document"?

How are you doing this? What dialog are you using?
Where have you got his Normal.dot saved?
Do you have another Normal.dot on your machine? In particular, one from an old version of Word, in your Templates directory?

Enjoy,
Tony

------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.

I'm working (slowly) on my own website
 
Thanks for listing those questions, Tony. I think it's helped me sort the problem out. I've been adding the Normal file to the "Global templates and add-ins" list in the "Templates and Add-Ins" dialog. I should have been using the "Document template" field instead. Perhaps there was a conflict between my Normal file loaded as the document template and the Normal file I was working on. Anyway, I can now edit the file while it's loaded as the template.

Thanks for the help, Tony. And thanks to the others that have chipped in!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top