Results 1 to 7 of 7
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Christchurch, New Zealand
    Posts
    250
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Templates stop working (Word 2K/Citrix)

    <img src=/S/bash.gif border=0 alt=bash width=35 height=39> One of my client sites is having a problem with templates I've set up. The installation is as follows:

    Workgroup and global templates are stored on the server, and if they have been modified they are copied down to the user's local drive on login. The user actually runs the templates locally.

    Everyone has the same setup and use the same templates.

    The workgroup templates are just "shells" containing formatting and boiler plate text. Macros that select the workgroup template required, and populate the resulting document and name and save it are all stored on the global template.

    For some reason the templates are not working for all users - they were originally, but not now. What happens is this:

    The user runs the first macro from the global template that displays a form where the user selects the required workgroup template. The next set of VBA procedures request information from the user to populate the document. The procedures should then call up the workgroup template required, populate it with information from the user, and name and save the document. However, the procedure to call up the template doesn't seem to kick in - it is almost as if there is an End statement immediately after the last user form is hidden. There isn't, and I'm not getting any displayed error messages.

    To confuse the issue further, if no documents are opened when the user first runs the macro to select a document, it generally works fine. However, sometimes, when other documents are open nothing actually happens!

    When I peruse what I've just written it doesn't make any sense to me at all. Suffice to say that the users affected, me and the network engineers are all tearing their hair out.

    Any hints on where we might start looking would be greatly appreciated. I keep saying that it can't be the templates, as they always used to work, and currently still work for other people, and sometimes for these affected users. The engineers have recreated profiles but no luck. I've also asked them to delete all normal templates on the local drives so that Word can create one new one.

    I need someone to wave a magic wand - or at least come up with something else we can look at..

    Thanks

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

    Re: Templates stop working (Word 2K/Citrix)

    Karen,

    The only idea that springs to mind: do you have any global variables in the global template, that serve as flags to control when certain things should happen and when they shoudn't? Possibly the values of these are getting set in unexpected ways - for example, if having a document open, or having just created a new document, is leaving some global flag set in an unexpected way and which is affecting the performance of the procedures the next time they are called....

    Gary

  3. #3
    Silver Lounger Charles Kenyon's Avatar
    Join Date
    Jan 2001
    Location
    Sun Prairie, Wisconsin, Wisconsin, USA
    Posts
    2,049
    Thanks
    124
    Thanked 119 Times in 116 Posts

    Re: Templates stop working (Word 2K/Citrix)

    Hi Karen,

    "To confuse the issue further, if no documents are opened when the user first runs the macro to select a document, it generally works fine. However, sometimes, when other documents are open nothing actually happens!

    When I peruse what I've just written it doesn't make any sense to me at all. Suffice to say that the users affected, me and the network engineers are all tearing their hair out."

    Some of it comes across as ambiguous to me, as well. When you are talking about what happens when a document is already open, are we talking, perhaps Word being open vs. not being open? When you say "nothing happens" are you saying there are no problems or that what you expect to happen, what should happen, does not? (Sorry for being so picky; it's the lawyer in me.)

    The difference in performance between when a document is already open and when there is no document open is certainly a clue.

    ActiveDocument = document with the focus
    ThisDocument or MacroContainer = document (template) containing the procedure

    You have a major debug ahead of you. How well things are documented and how well they are structured are going to be key. A sample of what I think of as well-structured and well-documented code is at http://www.mvps.org/word/FAQs/MacrosVBA/Sp...kProtectDoc.htm - although even there, I would make individual lines for variable declarations. I trust that you have declared "Option Explicit" at the beginning of each module.

    (side issue) Even if the workgroup templates are stored locally on each hard drive, they should be in a separate folder outside the user templates folder. I don't see this as a source of your problems, though.

    Typical debug procedures include putting in message boxes that pop up as each step in a procedure is executed. You would want to try inserting such a messagebox at the point where a document should be created.

    (philosophical aside) Rewriting everyone's normal.dot is a remedy to be avoided. Brings to mind a newspaper article I recently read about Burger King employees being required to participate in a motivational exercise where they walk over hot coals barefoot. I've done this and found it exhilerating and very useful. Nevertheless, I would never require someone working for me to do it. The more you limit people's workplace ability to change things (as in routinely wiping normal.dot) the more you strip the workplace of inherent motivators and non-monetary rewards. To the extent you can write your procedures to be impervious to user alteration of normal.dot, this is a plus. (IMO)

    BTW, your system sounds impressive. You might want to contact Dave Rado on the microsoft newsgroups for ideas. What you've done sounds right up his alley.

    Good luck.
    Charles Kyle Kenyon
    Madison, Wisconsin

  4. #4
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Christchurch, New Zealand
    Posts
    250
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Templates stop working (Word 2K/Citrix)

    There are global variables - I use them quite a bit. However, it's only happening for some users and has only started happening recently. These templates have been in use since the middle of last year.

  5. #5
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Christchurch, New Zealand
    Posts
    250
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Templates stop working (Word 2K/Citrix)

    Well, you're right - it is confusing. However, we've been doing some more sleuthing work and this is what we have found.

    I loaded Word without any global templates or macros. I then recorded a macro that simply started a new document based on a template that has no automation. This worked.

    I then tried to go into the Visual Basic editor (going through the menu) and Word was closed.

    Everytime we try and access the VBE Word is closed. I think therefore there is something wrong with VBE, not the macros themselves.

    Any ideas what could be interfering with the Visual Basic Editor?

  6. #6
    Silver Lounger Charles Kenyon's Avatar
    Join Date
    Jan 2001
    Location
    Sun Prairie, Wisconsin, Wisconsin, USA
    Posts
    2,049
    Thanks
    124
    Thanked 119 Times in 116 Posts

    Re: Templates stop working (Word 2K/Citrix)

    Try going into the VBE with a fresh normal.dot and no add-ins before recording anything. What happens?
    Charles Kyle Kenyon
    Madison, Wisconsin

  7. #7
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Christchurch, New Zealand
    Posts
    250
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Templates stop working (Word 2K/Citrix)

    Hi Charles, I was just going through my inbox to catch up on my mail and found your reply to my post. I created another global template, copied all the forms and modules from the first one into the second, then deleted the first template. We are no longer having any problems, and we are assuming that somehow the template was corrupted (for some users??). Anyway, it's working now.

Posting Permissions

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