Hi all
I have a routine in a workbook that is causing me quite a headache.
I have created and attached a simple version of the workbook for you to check out, but basically it pans out like this...
Excel 2007 does not support the AfterSave event as far as I'm aware, so I have included the generic BeforeSave event which cancels the users' original save request and allows me to perform some functions etc. This is all fine while the user saves the workbook in the standard way.
I have then added a "Save & Close" button which runs a simple macro to save and close the file. The ThisWorkbook.Save command triggers the BeforeSave event and certain functions are performed, but, the workbook does not save and certain functions to do with manipulating objects do not work e.g. hiding a WorkSheet.
I can make the WorkBook save by adding a second ThisWorkbook.Save command which is triggered when the program returns from the BeforeSave routine (I wrap it in Application.EnableEvents = False this time). The problem is that still certain activities do not trigger.
I guess the best way is to check out the code in the attached and hopefully someone may be able to explain what is going on. You will have to excuse my lack of knowledge, I'm kind of self-teaching VBA at the moment.
Code exists in Module 1 and ThisWorkbook
Many thanks in advance
Danny_
Bookmarks