closing boxes

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

O.K. here is my problem. I have a spread sheet demo that when opened has a
splash screeen (a user form) and then a couple of msg boxes. The user form
stays open even after the second msg box is opened, even though I unload it.
The first msg box stays open too. How do I get them to close before the next
item is opened? Thanks in advance.
 
This is my code:

Private Sub Workbook_Open()

Sheets("Customer Copy").Select

UserForm1.Show
End Sub

Private Sub CommandButton1_Click()
Application.OnTime Now + TimeValue("00:00:01"), "KillTheForm"
End Sub

Private Sub UserForm_Activate()

X = ThisWorkbook.Path
WebBrowser1.Navigate "file://" & X & "\WebBuilder.gif"
Application.OnTime Now + TimeValue("00:00:22"), "KillTheForm"


End Sub
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)

If CloseMode <> 1 Then Cancel = 1
End Sub

Private Sub KillTheForm()

Unload UserForm1

Macro_1

End Sub

Private Sub Macro_1()

If Sheets("Specs").Cells(110, 2) < Now Then

MsgBox "Your use of this demo has expired, please contact XXXX for more
information."
macro2
End If

macro3
End Sub
Private Sub macro2()

Application.DisplayAlerts = False
Application.Quit

End Sub
Private Sub macro3()
MsgBox "You have until 11/15/04 to view this demo!"
macro4
End Sub
Private Sub macro4()
MsgBox "This program was created for XXXX and is still in progress."
macro5
End Sub
Private Sub macro5()
Application.ScreenUpdating = False
Sheets("Customer Copy").Select
Worksheets(1).ScrollArea = "f1:y134"

Sheets("Options").Select
Worksheets(2).ScrollArea = "a1:ae429"

Sheets("Stratford Copy").Select
Worksheets(3).ScrollArea = "a1:ai42"

Sheets("Site Copy").Select
Worksheets(4).ScrollArea = "f1:y62"

Sheets("Specs").Select
Worksheets(5).ScrollArea = "a1:r95"


'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


With DialogSheets("Pricing Master")
.Visible = xlVeryHidden
End With

With DialogSheets("Modify Size")
.Visible = xlVeryHidden
End With
With DialogSheets("Garage")
.Visible = xlVeryHidden
End With
With DialogSheets("Estimated Bid Costs")
.Visible = xlVeryHidden
End With
With DialogSheets("Extras")
.Visible = xlVeryHidden
End With
With DialogSheets("Button")
.Visible = xlVeryHidden
End With



'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`

Sheets("Customer Copy").Select
Range("F1:Y1").Select
ActiveWindow.Zoom = True

Sheets("Options").Select
Range("A1:AE1").Select
ActiveWindow.Zoom = True

Sheets("Stratford Copy").Select
Range("A1:AI1").Select
ActiveWindow.Zoom = True

Sheets("Site Copy").Select
Range("F1:Y1").Select
ActiveWindow.Zoom = True


Sheets("Customer Copy").Select
Application.ScreenUpdating = True
DialogSheets("Pricing Master").Show
End SubThe code is split up like it is because someone suggested to me that this
would take care of the problem I also now have another problem. if you skip
the intro (comand button1) or if you try closing the splash screen (the X is
dissabled) after so long (I'm guessing the 22 sec delay but I haven't timed
it) macro1 starts running again and runs through the rest of the code again.
Any ideas?

-ryan clark
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top