PDA

View Full Version : Strange problem with SAVE Document



JPDO
01-19-2005, 02:07 PM
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.

Bilby
01-19-2005, 06:05 PM
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.

JPDO
01-20-2005, 06:20 AM
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 ?

TonyJollans
01-21-2005, 12:06 PM
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.

JPDO
01-26-2005, 01:58 PM
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 ?:think:

TonyJollans
01-27-2005, 08:14 AM
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.

Howard Kaikow
01-28-2005, 03:11 PM
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.