Coming along with generating Word documents from Excel, but running into a problem. The way I am creating the new document, there is no sign that a Word document is open. I guess that is good in this case, but I would like to know how to show the document if I do reconsider.
When I go to open that document, if it is already open (and because of the way I am doing so, no one would know if it were already opened by a failure earlier, Heaven forbid!) my vba simply hangs. No warning, no notice, the run simply hangs. I would like to know:
1) How to test if it is already open (And I don't know if I need to only test for if that document is open, or if Word is already open) so I could program around that, and also
2) If it is already open, is there a means to "crash through" that, either destroying that already open instance and then proceeding or working through the warning.
The most common I run into is a two-step process, where I first run into it already open so I have to stop everything, kill the process and move on, BUT, then I run into a sneaky remnant from that prior kill: Word once again hangs because it chooses to display a warning that the last time that document was opened it caused a serious problem... and once again I have to stop everything, kill the process, then I find I need to open the document, accept the warning that it caused a serious system problem and go ahead opening the document, then save the document back to where it originally was because Word chooses not to recognize the location any more, then I can run it all again. Royal Pain. Fine if all one is doing is addressing the document with Word, but not fine when trying to open it, modify it and save it programmatically!
Help?
The following was highly edited to get rid of a lot of ancillary material but preserve the basic construct as to how the document is being opened from Excel and manipulated:
Bookmarks