Closing Excel


Posted by Matt on February 15, 2002 2:16 AM

After I have run a macro, I want to close down Excel, can anyone help with the code for this.

Thanks

Matt

Posted by Ivan F Moala on February 15, 2002 2:18 AM

Application.Quit (NT)

Posted by Matt on February 15, 2002 2:38 AM

Re: Application.Quit (NT) (Error Generated)

Thanks have tried code but get following error message

Compile error:

Wrong number of arguments or invalid property assignment

Any ideas?

Posted by Ivan F Moala on February 15, 2002 3:11 AM

Re: Application.Quit (NT) (Error Generated)

This worked for me ??

Sub CloseExcel()
Application.Quit
End Sub


Ivan

I think you may have put in the (NT) ??!!

The (NT) stands for No text msg

Posted by Matt on February 15, 2002 4:49 AM

Re: Application.Quit (NT) (Error Generated)

Thanks Ivan,

I tried it with and without the (NT). Although the macro doesn't produce an error, Excel remains open. It doesn't make sense but that's life




Posted by Matt on February 15, 2002 5:01 AM

Re: Application.Quit (NT) (Error Generated)

Have taken out the previous line from my macro "ActiveWorkbook.Close" and everything now works. It doesn't appear to want to close down when there are no workbooks open. This worked for me ??