Public Wb As Workbook
Public RunWhen As Date
Public RunWhat As String
Public Executed As Boolean

Sub GetSavesStarted()
Set Wb = ThisWorkbook
RunWhat = "SaveThis"
Executed = True
Call SaveThis
End Sub

Sub SaveThis()
Application.DisplayAlerts = False
Wb.Save
Application.DisplayAlerts = True
RunWhen = Now + TimeValue("00:04:00")
Application.OnTime RunWhen, RunWhat
End Sub

Private Sub WorkBook_BeforeClose(Cancel As Boolean)

If Executed = True Then Application.OnTime EarliestTime:=RunWhen, Procedure:=RunWhat, _
Schedule:=False

End Sub


I am using this macro but , after some time Save as menu pops up, which is not required. So please help me.I want to Auto saving same excel file every 30 sec.