Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
MS Excel Spreasheet stuck smiley54663 Excel Discussion (Misc queries) 2 September 8th 09 04:09 PM
Stuck With Excel Problem Jeremy Excel Discussion (Misc queries) 5 September 1st 09 02:30 PM
AutoCalc in Excel is stuck! LR Excel Discussion (Misc queries) 2 May 1st 08 05:59 PM
Excel Concatenate - Please help, really stuck Dip Excel Discussion (Misc queries) 2 December 19th 05 06:30 AM
Help - now really stuck! File transfer problem ohboy! Excel Discussion (Misc queries) 10 May 2nd 05 09:07 PM


All times are GMT +1. The time now is 09:41 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"