Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
i'm stuck with an excel qujitting problem
Hello
I have a Worksheets with several vba macros. When a user opens it, it displays only a dialog (sort of welcome disclaimer), and when the user clicks ok, the rest of the worksheets are made visible. This works . Tomake sure that a startup no other ecxel windows are displayed, I created a before_Close routine, which hides all open windows of the workbook and then saves it. Closing the workbook works fine. Quitting excel hides and saves the workbook, but does not close Excel!!! I have to quit excel a second time, which then works. What's wrong ?? Any help is appreciated Ernst Code at startup: Private Sub Workbook_Open() Frm_Intro.Show ThisWorkbook.Windows(1).Visible = True ThisWorkbook.Worksheets("Input").Visible = True etc at close: Private Sub Workbook_BeforeClose(Cancel As Boolean) For Each Window In ThisWorkbook.Windows Window.Visible = False Next ThisWorkbook.Save |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
i'm stuck with an excel qujitting problem
Ernst,
Thisworkbook.close is not the correct method for "closing" Excel. You should be using "application.quit" -Tim -----Original Message----- Hello I have a Worksheets with several vba macros. When a user opens it, it displays only a dialog (sort of welcome disclaimer), and when the user clicks ok, the rest of the worksheets are made visible. This works . Tomake sure that a startup no other ecxel windows are displayed, I created a before_Close routine, which hides all open windows of the workbook and then saves it. Closing the workbook works fine. Quitting excel hides and saves the workbook, but does not close Excel!!! I have to quit excel a second time, which then works. What's wrong ?? Any help is appreciated Ernst Code at startup: Private Sub Workbook_Open() Frm_Intro.Show ThisWorkbook.Windows(1).Visible = True ThisWorkbook.Worksheets("Input").Visible = True etc at close: Private Sub Workbook_BeforeClose(Cancel As Boolean) For Each Window In ThisWorkbook.Windows Window.Visible = False Next ThisWorkbook.Save . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
MS Excel Spreasheet stuck | Excel Discussion (Misc queries) | |||
Stuck With Excel Problem | Excel Discussion (Misc queries) | |||
AutoCalc in Excel is stuck! | Excel Discussion (Misc queries) | |||
Excel Concatenate - Please help, really stuck | Excel Discussion (Misc queries) | |||
Help - now really stuck! File transfer problem | Excel Discussion (Misc queries) |