Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How do I close the whole Excel window? My goal is to exit without saving
data. If I write: this.Close(false, missing, missing); (in ThisWorkbook_BeforeSave event) the workbook closes without save, but the Excel window stays open, and thus the project is still in running mode. Thanks :) |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sandrina, use this,
Application.Quit -- Paul B Always backup your data before trying something new Please post any response to the newsgroups so others can benefit from it Feedback on answers is always appreciated! Using Excel 2002 & 2003 "Sandrina" wrote in message ... How do I close the whole Excel window? My goal is to exit without saving data. If I write: this.Close(false, missing, missing); (in ThisWorkbook_BeforeSave event) the workbook closes without save, but the Excel window stays open, and thus the project is still in running mode. Thanks :) |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sandrina:
try, ThisWorkbook.Saved = True Application.Quit -- 天行健,君*以自強不息 地勢坤,君*以厚德載物 http://www.vba.com.tw/plog/ "Sandrina" wrote: How do I close the whole Excel window? My goal is to exit without saving data. If I write: this.Close(false, missing, missing); (in ThisWorkbook_BeforeSave event) the workbook closes without save, but the Excel window stays open, and thus the project is still in running mode. Thanks :) |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks, but this doesn't work if you are in the BeforeSave event - it still
displays the SaveAs dialog. I solved the problem like this: Application.DisplayAlerts = false; Cancel = true; // the cancel that is provided as the BeforeSave argument Application.Quit(); return; "chijanzen" wrote: Sandrina: try, ThisWorkbook.Saved = True Application.Quit -- 天行健,君*以自強不息 地勢坤,君*以厚德載物 http://www.vba.com.tw/plog/ "Sandrina" wrote: How do I close the whole Excel window? My goal is to exit without saving data. If I write: this.Close(false, missing, missing); (in ThisWorkbook_BeforeSave event) the workbook closes without save, but the Excel window stays open, and thus the project is still in running mode. Thanks :) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
"X" at upper right of window to exit program is grayed out. | Excel Discussion (Misc queries) | |||
In Excel - how to delete new window created from window on tool ba | Excel Worksheet Functions | |||
How do I undo the Excel, Window Menu, New Window command | Excel Discussion (Misc queries) | |||
Excel window will not exit. | Excel Programming | |||
If a called sub exit, how to the caller exit right away? | Excel Programming |