Quit Excel problem

  • Thread starter Thread starter Steve
  • Start date Start date
S

Steve

Hi,

Can anyone tell me what's wrong with this macro? Its meant
to save the spreadsheet (which it does), shut down the
worksheet (which it does) and quit excel (which it
doesn't!)

I wondered whether it had something to do with the
worksheet containing the macro shuting before excel
executed the quit, but if I take out the
ActiveWorksheet.Close, whilst excel closes I get a
Dr.Watson application error.

Sub Exit_Save()
'
' Exit_Save Macro
' This macro saves the current work and quits the
application

Application.DisplayAlerts = False
ActiveWorkbook.SaveAs _
FileName:="C:\Budget Manager\Commitment Accounting
(new).xls", _
FileFormat:=xlNormal, _
Password:="", _
WriteResPassword:="", _
ReadOnlyRecommended:=False, _
CreateBackup:=False
ActiveWorkbook.Close
Application.DisplayAlerts = True
Application.Quit
End Sub

Any ideas greatly appreciated.

Cheers

Steve
 
Back
Top