Quit Excel problem

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top