.Originally Posted by Tommy
That was not a problem. Each and every template may have an AutoClose.
They do no harm by themselves.
A problem occurs if a sloppily written 3rd party critter such as PDFMaker lurks in the background and affects other things, sometimes in very subtle ways.
Another example. A few months ago, I decided to try a template from a well known organization. Each time, Word told me that I had changes to Normal.dot when I knew I did not. Normally, one can avoid such problems by using proper defenses in one's own Auto macros and document events. However, in that case, the template did something naughty in their document_close event which occurs AFTER my own stuff runs.
I was able to determine this because I knew how to look at the password protected code. As I am well connected with the owner of the code, they pointed me to the programmer and I pointed out the problem (and two alternative solutions). The programmer stated that he was aware of the problem and thought that he had prevented the problem. I pointed out to him WHY he missed it.
Many 3rd parties release Office code with just such problems.
PDFMaker is to be polite @$$#@%$!!.I also ran the test case for the PDFmaker and you are correct the error showed up.
Not all true, but I'll not dwell on this now.As I posted earlier this may be MS's way of preventing the spread of viruses. I do know that in Excel you cannot add a macro to a newly created sheet (via a macro/code) until it is saved, as MD as suggested, and johnske has suggested it is the same for Word. The thing is this all can be done in the VBIDE with no problem by "hand", so I feel that, taking it a step further, the problems involed with the commandbars is an intentional henderace to convince coders to supply templates with the commandbars instead of changing the normal.dot.
Sometimes the powers that be force code to be released even tho advised by the programmers or quality assurance folkes that the code is not ready. That's just unfortunately the way the world is (mis)run.Why? Because no good coder worth their salt will release something that they know is wrong.
But not right after the template is closed?The error occurs when Word is shutdown after all docs are closed.
Word is obviously confused as demonstrated by the duplicate toolbar issue. So whatever is causing that confusion is exacerbating some other problem with some other 3rd party app.