Which line is the error occurring on? That will make it easier to diagnose.
My observations are:
1. It is unusual to unload the userform and then expect the rest of the code to proceed since that code is inside the userform. I would recommend you remove that line from the Beta macro and put it at the end of the cmdYes_Click macro. Or better still, put it in the macro that called the userform in the first place. I use Me.Hide at the end of macros when I want to get rid of the userform. This allows the code to run to completion.
2. Application.Templates(ActiveDocument.AttachedTempl ate.FullName). is overly indirect. Try this instead ActiveDocument.AttachedTemplate.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
|