Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Macro Question 1

Status
Not open for further replies.

tlaksh

Programmer
Feb 25, 2001
98
0
0
US
Hi ,

I am using Excel 97 and am using a macro to do some processing. At the end i have a commands to save and close workbooks and then quit excel ..

Application.Quit is what i am using to quit from excel.

Now the problem is it closes all the worksheets but does not close excel.

Can anyone help me with this...??

Thanks a ton

Laksh.



 
Is it on the on close event for the workbook?
 
The problem is that when you close the workbook, the macro stops. This happens because the macro is part of the workbook. If you want to save the workbook and quit the application, try this.
Code:
ActiveWorkbook.Save
Application.Quit
 
I tried application.quit in both Excel 97 and Excel 2000 and it closes Excel no problem. I wonder if this line of code isn't actually being run and you don't realize it. Sorry I couldn't be of more help. Perhaps if you posted some of the code, maybe I could help more. :)
 
Thanks guys ...DSI's option worked...I was closing the workbook and so it did not recognize the next line:) Silly me....:)

Anyways thanks again..

Laksh.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top