HiThat explains why the macro stops when at the close - The macro is there , running, but then you close it, so its gone.
If you run a macro that is in a document and that macro closes the document, then nothing can happen after the close because both the document and macro is no longer there.
It is like driving a car on a journey, and on the way, in the middle of the journey, God comes and takes your car and the engine away. So the journey stops
Like this
WORD: [document and start macro running ]
WORD: [document and macro running ]
WORD: [document and macro running - macro closes the document ]
WORD: [ _________________________ ] - all is gone. There is nothing there - no document , no running macro. Macro cannot finish - there is no macro - its gone because you closed it
Important: You can stop a macro like this by closing the document with the macro in it. But it is dangerous to do it.
It is like if you are in a plane and want to land. So you take the engine away. The plane will come down. If you are lucky it will come down and stop. If you are unlucky the plane may crash. You may die.
You can stop a macro like this by closing the document with the macro in it. If you are lucky the macro will stop. If you are unlucky your computer may crash. It may die.
Also: A .docx cannot hold a macro - you can try it - try to save a .docx file with a macro in it. - It will not work
A macro can go in normal template or in a docm file
Good luck
Please let us know how you get on.
Alan
Bookmarks