Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
closing excel after closing a workbook
Hi all,
I would like to be able to close active workbook (without saving) and then close Excel completely via a button on a userform. At present I use the following to close the workbook but this leaves Excel running. ActiveWorkbook.Close False Thanks in advance chris --- Message posted from http://www.ExcelForum.com/ |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
uit closing excel after closing a workbook
Chris,
Use Application.Quit -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "CWalsh " wrote in message ... Hi all, I would like to be able to close active workbook (without saving) and then close Excel completely via a button on a userform. At present I use the following to close the workbook but this leaves Excel running. ActiveWorkbook.Close False Thanks in advance chris --- Message posted from http://www.ExcelForum.com/ |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
closing excel after closing a workbook
Hi, the following code would do, what you need :
Sub closeAndQuit() Dim xlAp As Application Activeworkbook.Saved = True Set xlAp = ActiveWorkbook.Application xlAp.Quit End Sub In this case, your workbook won't be saved and the Excel applicatio will quit. If You wish to save the activeworkbook before closing Excel, you shou try this instead of "Activeworkbook.Saved = True" : ActiveWorkbook.Save (if it's saved before) or ActiveWorkbook.SaveAs FileName:="Filename.xls" but remember, if you have more than one Workbooks, it should've bee done for each one -- Message posted from http://www.ExcelForum.com |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
closing excel after closing a workbook
Dear Tolgag
Your answer was great - I have used this and now when I alt-crt-del the excel process no longer shows as running. Thank you so much C --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Closing workbooks w/o closing Excel | Excel Discussion (Misc queries) | |||
Closing a workbook exits Excel Application | Excel Discussion (Misc queries) | |||
Closing only one excel workbook | Excel Discussion (Misc queries) | |||
EXCEL.EXE has generated an error...when closing a workbook | Excel Programming | |||
Web links in Excel closing workbook | Excel Programming |