Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default form stops execution

If you go into tools=References (in the VBE) after the error, does it have
a reference to the Microsoft Forms 2.0 library?



--
Regards,
Tom Ogilvy


"Marcos" wrote in message
ups.com...
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default form stops execution

Hi & thanks,
after stopping the debugger, Tools references highlights the windows
commn controld 6 row

Marcos

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default form stops execution

If you application doesn't use that control, uncheck it. If you can't then
select it and hit the browse button and see if you can fix the reference by
finding it.

If it isn't needed, try unchecking it or going back to the machine where the
workbook was created and uncheck it there. Then copy the revised file and
trying to use it on the new machine.

--
Regards,
Tom Ogilvy




"Marcos" wrote in message
oups.com...
Hi & thanks,
after stopping the debugger, Tools references highlights the windows
commn controld 6 row

Marcos



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default form stops execution

Thanks,
but it seems that this reference is in use, as VB says it can't remove
the control.
The control file (mscomct2.ocx) is present in both computers.
(the developing computer is WinXP and excel 2000 - where it works file,
and the other is win2000 with excel 2002)

Marcos



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default form stops execution

If you know it isn't being use, then I have been successful in removing a
reference using code.

See the reference collection in the Microsoft Visual Basic Extensibility
Library.

It has a remove method.

--
Regards,
Tom Ogilvy


"Marcos" wrote:

Thanks,
but it seems that this reference is in use, as VB says it can't remove
the control.
The control file (mscomct2.ocx) is present in both computers.
(the developing computer is WinXP and excel 2000 - where it works file,
and the other is win2000 with excel 2002)

Marcos


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
Active Form during Execution BillCPA Excel Discussion (Misc queries) 0 August 11th 06 03:15 PM
Form Updating during Execution BillCPA Excel Discussion (Misc queries) 0 August 9th 06 04:55 PM
Tab Stops brentm Excel Programming 2 April 21st 05 07:20 PM
VBA execution stops at ActiveSheet.Copy -- but only sometimes! Ole M Halck Excel Programming 3 August 19th 04 04:47 PM
Tab Stops Summer Excel Programming 1 April 29th 04 05:37 PM


All times are GMT +1. The time now is 12:04 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"