Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default BeforeClose VBA Question??

Hi folks

First, if Vasant is reading this, I'd like to thank him for some hel
he posted to me in the MS Excel forums. I received his answer, i
worked fine, but then was unable to log back on to that forum....an
haven't been ever since. Anyway.....Thanks Vasant...appreciate you
help.... :)

Now the current problem. I have a WorkBook, let's call i
WorkBook(1), that both opens and closes with code.....pasted below

Private Sub Workbook_Open(
Application.DisplayFullScreen = Tru
Application.ScreenUpdating = Fals
With ActiveWindo
.DisplayHeadings = Fals
.DisplayOutline = Fals
.DisplayHorizontalScrollBar = Fals
.DisplayVerticalScrollBar = Fals
.DisplayWorkbookTabs = Fals
End Wit
With Applicatio
.DisplayFormulaBar = Fals
.DisplayStatusBar = Fals
End Wit
Application.CommandBars("Standard").Visible
Fals
Application.CommandBars("Formatting").Visible
Fals
Application.CommandBars("Drawing").Visible
Fals
End Su

Private Sub Workbook_BeforeClose(Cancel As Boolean

Application.DisplayFullScreen = Fals
Application.ScreenUpdating = Tru
With ActiveWindo
.DisplayHeadings = Tru
.DisplayOutline = Tru
.DisplayHorizontalScrollBar = Tru
.DisplayVerticalScrollBar = Tru
.DisplayWorkbookTabs = Tru
End Wit
With Applicatio
.DisplayFormulaBar = Tru
.DisplayStatusBar = Tru
End Wit
Application.CommandBars("Standard").Visible
Tru
Application.CommandBars("Formatting").Visible
Tru
Application.CommandBars("Drawing").Visible
Fals
Saved = Tru
Application.Qui

End Su


What I've tried to do is keep as many of the tool bars etc away fro
the op as much as possible. All data is entered through a DataFor
that opens with a click of a button. Also, to explain some of th
above code, none of the data is to be saved, it's merely printed ou
on a form by way of one of several macros

Within Workbook(1) there is a msgbox (Y/N) that pops up at define
intervals, allowing the op to either continue working with a "Y
response or quit WorkBook(1) and Excel with a "N" response. Msgbo
code below

[code:1:129092220e]Sub EndProg(

' Closes Exce
' Macro written 5/12/2005 by D

Dim Msg, Style, Title, Help, Ctxt, Response, MyStrin
Msg = "Would you like to print another form?
Style = vbYesNo + vbQuestio
Title = "Estimated Billing Form Query
Response = MsgBox(Msg, Style, Title, Help, Ctxt
If Response = vbYes The
MyString = "Yes
Sheets("INTRO").Selec
Els
MyString = "No
Workbooks("EstimatedBillingForms4").Clos
SaveChanges:=Fals
End I
End Su
[/code:1:129092220e

Problem is when Workbook(1) and Excel close, using the msgbox "N", an
you re-open Excel to a new or different WorkBook, the sheet-tabs ar
not visible. They are checked in the Options box but do not show o
the sheet. Unchecking and re-checking them again has no affect

However, if you open Workbook(1), then click on the "X" (upper righ
corner), Workbook(1) and Excel close properly, and the next openin
of Excel is fine...shows the sheet tabs

Any help here would be greatly appreciated

Do

....Looks like this thing got double posted...not sure how, but it'
in here twice.....sorry about that

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
beforeclose placement Curt Excel Discussion (Misc queries) 9 August 27th 07 08:00 PM
ThisWorkBook BeforeClose Event Doug Glancy Excel Programming 0 July 29th 04 12:36 AM
Workbook BeforeClose Bug John Camburn Excel Programming 0 July 9th 04 09:29 PM
BeforeClose Dilemma J. Cornor Excel Programming 0 June 21st 04 07:39 PM
Cancelling the BeforeClose Event Troy[_5_] Excel Programming 6 December 2nd 03 06:40 AM


All times are GMT +1. The time now is 01:47 PM.

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"