Originally Posted by
galvinpaddy
1) it also saves any other workbook that is open
...
The workbook's name changes daily, as we 'Save As' a new name that includes the date.
To avoid this, check whether ThisWorkbook.Name = the expected workbook name that includes the date. What is the file name of the new workbook that includes the date (give an example)? In the code below I've assumed the workbook file name is in the format "Workbook yyyy-mm-dd.xls", e.g. "Workbook 2012-05-03.xls" for today.
Originally Posted by
galvinpaddy
2) if i have more than one workbook open, and close the one with this particular code, the code re-opens the sheet and saves it again and again, until i fully close excel.
To avoid this, cancel the OnTime procedure in the Workbook_BeforeClose event handler.
I've incorporated both these fixes in the code below:
Put the following code in the ThisWorkbook module
Put the following code in a standard module e.g. Module1
Bookmarks