I'm having some real difficulties sorting out some automation code. I have a Word template with all the relevant bokkmarks, some code tht fills the book marks, asks the user for a file name and saves the file. The code then either emails the file as an attachment using Outlook automation, or prints the file off to provide a hard copy.
My problem is with the exit handler, it just can not clean up the instances of Word I've created, run time error 462 is what it says. Now I've been to the MSKB for a solution, I've read Wendell's rather good tips on Automation, I've tried everything I understand from these and frankly I'm in over my head.
If necessary I'll post the code, but it's long as the whoe thing runs from one button and uses input forms and message boxes to select the next activity.
Assuming I've not got any .Active.Document type entries (the cause of error 462as far as I can understand it) what else do I need to ensure is covered by the objWord instance I use to create a word application? I've tried using the New Word.Application and the CreateObject("Word.Application") alternative to it (although I don't see the difference, all I get is it's a 'binding' issue).
Apologies for the length of this post, but I'm trying to explain it without having anyone read through many many lines of code.