Results 1 to 10 of 10
  1. #1
    Silver Lounger
    Join Date
    Jan 2001
    Location
    West Long Branch, New Jersey, USA
    Posts
    1,921
    Thanks
    6
    Thanked 9 Times in 7 Posts

    Word Template Locked (2000 SR1)

    Good-day (or night),

    I was cleaning up my Normal.dot today. One thing I did was to get rid of macro/modules and forms and put them into a separate template. This was done by removing and exporting all of the modules and forms and putting the resulting files into a folder.

    Then I created a new template and imported all of the files from the folder. (I didn't realize I could drag modules in the VBE until afterwards but I don't think this matters with respect to the problem I have.)

    I added the new template to a file I was working on. When I went to look in the VBE at the modules and forms in the new template project, all was peachy keen.

    Then I went back out to the word document, did some things, and went back into the VBE to look at the new template's modules. Now I got a message saying the Project is Unviewable. This came when I clicked the + in the Project window. Since I wanted to get at some of the code in the modules, this was unacceptable.

    So I started over again. Got rid of the template, created a new one, re-imported the modules and forms from the folder. This time, I wasn't even able to look at the template modules at all - got the Project is Unviewable msg immediately.

    I can get at the macros from Tools } Macros to run them but I can't edit the code.

    1. what did I do to make the template project unviewable? (I am not aware of any conscious act)
    2. any way to make it viewable again?
    3. any ideas on why the project was viewable initially the first time around?

    One other thing that might be relevant: the Normal.dot that I started with was converted from a Word 97 Normal.dot when I loaded Word 2000 about a month ago. The Word 2000 version of Normal.dot was my starting point for slimming Normal.dot and creating my new template. I still have the old Normal.dot from Word 97 with its bloat in the folder that Word 97 kept templates in. So the modules imported into my new template under Word 2000 started life in Word 97. Not sure why this would be relevant, especially since I exported the modules and imported them. I looked at the modules in Notepad. Other than a bunch of Sub...End Sub macros (about 5 or 6 of them), there is only the following on line 1 of the .bas file:
    Attribute VB_Name = "FB_Utility_Macros"

    TIA

    Fred

  2. #2
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: Word Template Locked (2000 SR1)

    Fred,

    I've never understood the sequence of events that leads to this happening, but I can assure you that you are not alone.
    The only workaround that I have found is to completely exit from word, saving everything as I exit, and then start Word again and reopen the documents.

    StuartR

  3. #3
    Silver Lounger
    Join Date
    Jan 2001
    Location
    West Long Branch, New Jersey, USA
    Posts
    1,921
    Thanks
    6
    Thanked 9 Times in 7 Posts

    Re: Word Template Locked (2000 SR1)

    Stuart,

    Thks for the reply.

    So if I understand your approach, once the template becomes unviewable, save all in sight, exit word, and re-enter. I'm sure I must have done that. However, my PC is off right now. If your approach works, when I turn it on and look at the new template, I should be able to see the code in the modules.

    I wonder if I add the template to a different doc if I'll get different results.

    Forgive me if I sound skeptical [couldn't find a smilie for that feeling]; this must be an MS "feature". I'll see tonight when I turn on the PC.

    Fred

  4. #4
    Silver Lounger
    Join Date
    Jan 2001
    Location
    West Long Branch, New Jersey, USA
    Posts
    1,921
    Thanks
    6
    Thanked 9 Times in 7 Posts

    Re: Word Template Locked (2000 SR1)

    Stuart,

    After some more experimenting:
    -closing word and reopening didn't help
    -however, opening the template itself in Word and then going into the VBE showed all the modules and forms and I could edit them. Checking the properties of the project, there was no password and it wasn't locked. Strange.

    Fred

  5. #5
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: Word Template Locked (2000 SR1)

    I have never been able to make sense of this one. <img src=/S/confused.gif border=0 alt=confused width=15 height=20>
    If you ever learn any more about what causes it please let us know.

    StuartR

  6. #6
    New Lounger
    Join Date
    Sep 2002
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word Template Locked (2000 SR1)

    Hello Fred,

    sometimes even Microsoft-Software reacts like it's designed to do.

    The problem you mention I think, is no problem. It's just the way to work with it. You wrote, that you worked on the document and I think at that time your Template was not opened. As long you work in an document attached to a template and the template is not opened either, your Modules are always unviewable in the VBE. Open the original template your document is attached to and you can view every module, too!
    Good luck
    Dirk

  7. #7
    Silver Lounger
    Join Date
    Jan 2001
    Location
    West Long Branch, New Jersey, USA
    Posts
    1,921
    Thanks
    6
    Thanked 9 Times in 7 Posts

    Re: Word Template Locked (2000 SR1)

    Dirk,

    Thks for the insight. Maybe in my first go round, I may have had the template open at the same time as a document that added it to its list of templates. At some time, including the 2nd time, the template was definitely not open. I'll play a little more to see what happens.

    Fred

  8. #8
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts

    Re: Word Template Locked (2000 SR1)

    Dirk,

    Need to clarify something here: If you work in a document which is based on a template, and that template contains code modules, you definitely should be able to see, access and edit the code in the template's code modules - you should be able to modify that code and save it from within the VBE - even when the template itself is not open as a document.

    The only situation in which a template's code modules are by design not viewable if the template itself is not open as a document, is when that template is currently loaded as a global add-in.

    If Fred is working with an "attached" template which is not loaded as a global add-in, then the problem with not being able to view the modules is being caused by another problem. I also saw a similar problem to this a long time ago; it had something to do with changing the attached template for a document, while having the code in the original template open in the VBE. I can't reproduce the steps now but it appeared to have to do with Word getting confused as to which template the code belonged to. I just learned to avoid that situation.

    Gary

  9. #9
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: Word Template Locked (2000 SR1)

    It just happened to me again.

    I was working on a Global Template, that contains lots of modules.
    I added some procedures to one of the modules and ran them with no problems.
    I saved the project, signing it with my key.
    I closed the Global Template.
    A bit later I opened the Global Template again and tried to change a procedure, but it was unviewable.
    I saved the global template, closed it and re-opened it again - but still couldn't access the modules.
    Nothing I tried would allow me to view the modules until I had exited from word and started it again.

    StuartR

  10. #10
    Silver Lounger
    Join Date
    Jan 2001
    Location
    West Long Branch, New Jersey, USA
    Posts
    1,921
    Thanks
    6
    Thanked 9 Times in 7 Posts

    Re: Word Template Locked (2000 SR1)

    Gary,

    A little more experimentation on this:
    - if my template is what a doc is based on, I can view the modules in the VBE sometimes and not at others. But this was in the same session of word that I opened and closed various docs and checked what was viewable in the VBE.
    - if my template is added as a global addin, I can not. This seems to be universal.

    Fred

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •