Question : Excel 2010 - Workbook_Close()

I am trying to use the following code in 'ThisWorkbook'. The problem I am having is that it is not running the code on closing the workbook. I am just getting the normal do you wish to save changes question, which I always get, and the code below appears to be being ignored as it is not saving and not resorting.

Private Sub Workbook_Close()
    ActiveSheet.Range("$A$1:$S$2964").AutoFilter Field:=1
    ActiveWorkbook.Save
End Sub

Anyone?

Answer : Excel 2010 - Workbook_Close()

Try the BEFORE CLOSE event.
Scott C
Random Solutions  
 
programming4us programming4us