AD_Taylor
Well-known Member
- Joined
- May 19, 2011
- Messages
- 687
I have a workbook that uses the =TODAY function in some of the cells and due to this it always asks me if I want to save changes when I open it on a different day.
I want to add a Workbook Before Close Event to it that so that when I press close it will automatically save before it then closes down.
I currently have this:
Couple of questions:
1) What would happen with this code if I used it in a new workbook that hadn't been previously saved?
1a) Can I check to see if it was previously saved or not?
2) Are there any negatives that can be thought of by using code like this? For this workbook I will always want to save it, there is no question of that.
I want to add a Workbook Before Close Event to it that so that when I press close it will automatically save before it then closes down.
I currently have this:
Code:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
ActiveWorkbook.Save
End Sub
1) What would happen with this code if I used it in a new workbook that hadn't been previously saved?
1a) Can I check to see if it was previously saved or not?
2) Are there any negatives that can be thought of by using code like this? For this workbook I will always want to save it, there is no question of that.