Hi there
I'm going mad!
I have a working script to capture the user name and date of modification before close. The script is saved as a event headed : Private Sub Workbook_BeforeClose(Cancel As Boolean) in the VB script Editor under This WorkBook.
It works perfectly when you open a fresh instance of Excel.
After the workbook is closed and if I reopen the same workbook again (without quitting Excel), it does not execute the code unless I quit Excel and relaunch it again. So I can get round this with Application.Quit
However, I cannot ensure that users will always open this workbook in a fresh instance of Excel. They could be openning this workbook after working on other workbooks with some other Before Close routines in the same instance of Excel.
Is this a bug in Excel? Can anyone help to find a way round this?
Thank You
I'm going mad!
I have a working script to capture the user name and date of modification before close. The script is saved as a event headed : Private Sub Workbook_BeforeClose(Cancel As Boolean) in the VB script Editor under This WorkBook.
It works perfectly when you open a fresh instance of Excel.
After the workbook is closed and if I reopen the same workbook again (without quitting Excel), it does not execute the code unless I quit Excel and relaunch it again. So I can get round this with Application.Quit
However, I cannot ensure that users will always open this workbook in a fresh instance of Excel. They could be openning this workbook after working on other workbooks with some other Before Close routines in the same instance of Excel.
Is this a bug in Excel? Can anyone help to find a way round this?
Thank You