M
mdc1952
I'm creating a template that will be opened by users and saved to a new
name based on info provided by the user. I have macros triggered by
opening and closing the workbook. The before closing sub does some data
transfer between workseets. I'm running into a problem with the open
sub, however. I wanted to give the user a chance to abort the opening,
giving a dialog that allows canceling. I wanted to just close the
workbook. However, if I include a Workbook.Close line in the Open sub,
it of course triggers the before close sub, but seems to leave the On
Open sub hanging. The workbook closes, but the next time I open it, the
dialog in the Open sub doesn't come up. Close again, and it works ok or
quit Excel between openings and it is ok.
Is there some method I can use to cleanly get out of the On open sub
when I want to abort and still have a BeforeClose sub?
name based on info provided by the user. I have macros triggered by
opening and closing the workbook. The before closing sub does some data
transfer between workseets. I'm running into a problem with the open
sub, however. I wanted to give the user a chance to abort the opening,
giving a dialog that allows canceling. I wanted to just close the
workbook. However, if I include a Workbook.Close line in the Open sub,
it of course triggers the before close sub, but seems to leave the On
Open sub hanging. The workbook closes, but the next time I open it, the
dialog in the Open sub doesn't come up. Close again, and it works ok or
quit Excel between openings and it is ok.
Is there some method I can use to cleanly get out of the On open sub
when I want to abort and still have a BeforeClose sub?