Consulting

Results 1 to 7 of 7

Thread: Strange problem with SAVE Document

  1. #1
    VBAX Regular
    Joined
    Sep 2004
    Posts
    34
    Location

    Strange problem with SAVE Document

    Hi,
    I have an Excel-macro that fills in automatically a WORD-document based on a Word template.
    This template contains a few macro-codings to fill-up some fields in the document when the user should change some values (after the creation of the document).
    When the document is filled up the excel-macro saves the whole thing (document AND macro-coding) in the same document with the .doc extension.
    When some users are clicking upon the saved-document it opens, but no macro-code is saved in it; other users do not have that problem Macro-code is saved and works fine in the Word-document.
    I do not know what the cause of this problem can be;
    Has some one seen this before ?
    I work with Office XP, Word 2003 and Excel 2003

    Any ideas are greatly appreciated.
    Thanks anyway.

  2. #2
    VBAX Regular
    Joined
    Sep 2004
    Posts
    65
    Location
    Have you checked the security settings in your clients Word apps?
    Also some anti-Virus software may block Macro viruses from writing themselves to a Word doc, Your attempt to save code to a document could be triggering your anti-v software.

  3. #3
    VBAX Regular
    Joined
    Sep 2004
    Posts
    34
    Location
    Thanks for your reply Bilby,
    The security settings in the clients Word apps and excel app is set to low.
    I thought this could not block the save-operation.
    About the anti-virus software i do not have much experience.
    I will investigate in it next monday.
    What i find so strange is that it works on some PC's and not on others.
    So i tought more in the direction of settings of the Word-sofware, perhaps the normal.dot settings or even the object-references in VBA.
    Are there somewhere settings that inhibit saving-macro-code ?
    Has some one experience or usefull hints with this ?

  4. #4
    VBAX Master TonyJollans's Avatar
    Joined
    May 2004
    Location
    Norfolk, England
    Posts
    2,291
    Location
    I am surprised you EVER get the code. What I would expect to happen is for your document, based on the template, to be saved with only what you have explicitly put in it, and the code to remain in the template. When the document is next opened the attached template is also opened and any code in the template is available.

    My guess is that you never write the code but some users have access to the template and some don't.
    Enjoy,
    Tony

    ---------------------------------------------------------------
    Give a man a fish and he'll eat for a day.
    Teach him how to fish and he'll sit in a boat and drink beer all day.

    I'm (slowly) building my own site: www.WordArticles.com

  5. #5
    VBAX Regular
    Joined
    Sep 2004
    Posts
    34
    Location

    Question Probably detected the problem .....

    Thanks for your reply, Tony.

    It looks like you said: the template and the document are stored in different places. I strongly think that the PC of the user where the template-macro not works like expected has somewhere an other version of the template than mine.

    I will investigate tomorrow where it is stored. I guess somewhere in the template-directory mentionned in the file locations of MS Word specified on their PC.
    If this is true i wonder how i should proceed when i have some changes on the actual template. Usually i make the changes on my PC and copy/paste the new template in a PC-LAN-directory readable for each user. Would this still work or is it necessary to do this on EACH user-PC ?

  6. #6
    VBAX Master TonyJollans's Avatar
    Joined
    May 2004
    Location
    Norfolk, England
    Posts
    2,291
    Location
    Hi JPDO,

    I'm not entirely sure of the search order but Word should look first for a template in the same directory as the document - so maybe you could store the two together. If not there really isn't much you can do about users who have (out of date) copies of templates in their own directories - unless you want to start adding code to the document itself.
    Enjoy,
    Tony

    ---------------------------------------------------------------
    Give a man a fish and he'll eat for a day.
    Teach him how to fish and he'll sit in a boat and drink beer all day.

    I'm (slowly) building my own site: www.WordArticles.com

  7. #7
    VBAX Mentor
    Joined
    Sep 2004
    Location
    Nashua, NH, USA
    Posts
    489
    Location
    Quote Originally Posted by JPDO
    Hi,
    I have an Excel-macro that fills in automatically a WORD-document based on a Word template.
    This template contains a few macro-codings to fill-up some fields in the document when the user should change some values (after the creation of the document).
    When the document is filled up the excel-macro saves the whole thing (document AND macro-coding) in the same document with the .doc extension.
    When some users are clicking upon the saved-document it opens, but no macro-code is saved in it; other users do not have that problem Macro-code is saved and works fine in the Word-document.
    I do not know what the cause of this problem can be;
    Has some one seen this before ?
    I work with Office XP, Word 2003 and Excel 2003

    Any ideas are greatly appreciated.
    Thanks anyway.
    R U saving the Word macro code in the document itself (not a good idea), or is the macro code actually in the template attached to the document?

    I suspect the latter.

    When users open the document, if they have the template, they will see the code, otherwise they will not see the code.

Posting Permissions

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