Maximus Tatius
New Member
- Joined
- Oct 19, 2008
- Messages
- 41
I have a fairly complex workbook which contains a worksheet I use as a template for a new workbook - I populate this as part of a long script which fires when I click a command button on a form, then copy this sheet to a new workbook which I create and save in the same script.
This works fine but it would be perfect if I could find a way to programmatically add a BeforeClose event to that new workbook.
Is that possible, or should I be looking at not using Workbooks.Add to create the new workbook and (instead) using a workbook template which already has the BeforeClose event written into it?
I did find this VERY old bit of coding which suggests that it IS possible, though I must admit I found it a bit confusing.
For information the BeforeClose event is to turn automatic calculation off, if that's what the user had his application set as, before they open the new workbook.
This works fine but it would be perfect if I could find a way to programmatically add a BeforeClose event to that new workbook.
Is that possible, or should I be looking at not using Workbooks.Add to create the new workbook and (instead) using a workbook template which already has the BeforeClose event written into it?
I did find this VERY old bit of coding which suggests that it IS possible, though I must admit I found it a bit confusing.
For information the BeforeClose event is to turn automatic calculation off, if that's what the user had his application set as, before they open the new workbook.