View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Marcos[_2_] Marcos[_2_] is offline
external usenet poster
 
Posts: 6
Default form stops execution

In excel macro working fine on Excel 2000 stops in excel 2002.
the macro stops at the statement showing a form. The debugger just
stops and highlights the show line with no error explanation. The form
includes a textbox and 2 buttons.

The calling sub is:
Option Compare Text
Public bOK1 As Boolean

Sub Auto_Open()
Dim s As Object
Dim x As String
Dim y As Integer
ExitStatus = False
Unload entrance
Do
entrance.Show
If Not bOK1 Then Exit Sub
x = entrance.bUser.Value
y = Val(x)
If y 0 Then
Set s = Sheets("TS")
d = Date
Do Until Weekday(d, vbSunday) = vbThursday
d = d + 1
Loop
s.Range("AM5") = d
s.Range("R3") = y
Exit Do
End If
Loop
Unload entrance
End Sub

And the form code is:
Private Sub bUser_Change()
End Sub

Private Sub CommandButton1_Click()
bOK1 = False
Unload Me
End Sub

Private Sub CommandButton2_Click()
bOK1 = True
Me.Hide
End Sub

Private Sub TextBox1_Change()
End Sub

Private Sub UserForm_Click()
End Sub

Thanks very much for your help
Marcos