vb working in excel 2007 not in 2003

GerardAcision

New Member
Joined
May 13, 2009
Messages
38
Hi, I have created a few forms using vb in excel 2003, since a few weeks I am using excel 2007. When I asked another to use the excel sheet, while it was saved as excel 2003, the script hung and one could see it was conitinually calculating. Any on suggestions how to avoid this. The part where it hung is the following, I was thinking maybe it is at this moment to large, the total workbook is over 8 mb.

Any one who can help me fix this?

Regards
Gerard

Code:
Private Sub SetTB(Min As Long, Max As Long, State As Boolean)
Dim i As Long
    For i = Min To Max
        Me.Controls("TextBox" & i).Visible = State
    Next i
End Sub
Private Sub CommandButton5_Click()
    Application.Calculation = xlCalculationAutomatic
    Input4_services_data_1_10.Hide
    Input5_services_data_11_20.Show
    Application.Calculation = xlCalculationManual
End Sub
 
Private Sub UserForm_Initialize()
    Call SetTB(2, 23, True)
    Call SetTB(25, 32, True)
    Call SetTB(34, 36, True)
    Label16.Caption = Sheets("Parameters - service").Range("A5").Value
    Label17.Caption = Sheets("Parameters - service").Range("A6").Value
    Label19.Caption = Sheets("Parameters - service").Range("A7").Value
    Label18.Caption = Sheets("Parameters - service").Range("A8").Value
    Label21.Caption = Sheets("Parameters - service").Range("A9").Value
    Label22.Caption = Sheets("Parameters - service").Range("A10").Value
    Label23.Caption = Sheets("Parameters - service").Range("A11").Value
    Label20.Caption = Sheets("Parameters - service").Range("A12").Value
    Label24.Caption = Sheets("Parameters - service").Range("A13").Value
    Label28.Caption = Sheets("Parameters - service").Range("A17").Value
    Label30.Caption = Sheets("Parameters - service").Range("A18").Value
    Label29.Caption = Sheets("Parameters - service").Range("A19").Value
    Label32.Caption = Sheets("Parameters - service").Range("A20").Value
    Label33.Caption = Sheets("Parameters - service").Range("A21").Value
    Label35.Caption = Sheets("Parameters - service").Range("A26").Value
    Label37.Caption = Sheets("Parameters - service").Range("A31").Value
    Label38.Caption = Sheets("Parameters - service").Range("A32").Value
    Label40.Caption = Sheets("Parameters - service").Range("A36").Value
    Label41.Caption = Sheets("Parameters - service").Range("A37").Value
    Label42.Caption = Sheets("Parameters - service").Range("A38").Value
    Label43.Caption = Sheets("Parameters - service").Range("A39").Value
    Label44.Caption = Sheets("Parameters - service").Range("A40").Value
    Label46.Caption = Sheets("Parameters - service").Range("A44").Value
    Label47.Caption = Sheets("Parameters - service").Range("A45").Value
    Label48.Caption = Sheets("Parameters - service").Range("A46").Value
    Label49.Caption = Sheets("Parameters - service").Range("A47").Value
    Label51.Caption = Sheets("Parameters - service").Range("A52").Value
    Label52.Caption = Sheets("Parameters - service").Range("A53").Value
    Label53.Caption = Sheets("Parameters - service").Range("A54").Value
    Label54.Caption = Sheets("Parameters - service").Range("A55").Value
    Label55.Caption = Sheets("Parameters - service").Range("A56").Value
    Label56.Caption = Sheets("Parameters - service").Range("A58").Value
    Label57.Caption = Sheets("Parameters - service").Range("A59").Value
    Label25.Caption = Sheets("Input - components").Range("C5").Value
    Label58.Caption = Sheets("Input - components").Range("D5").Value
    Label59.Caption = Sheets("Input - components").Range("E5").Value
    Label60.Caption = Sheets("Input - components").Range("F5").Value
    Label61.Caption = Sheets("Input - components").Range("G5").Value
    Label62.Caption = Sheets("Input - components").Range("H5").Value
    Label63.Caption = Sheets("Input - components").Range("I5").Value
    Label64.Caption = Sheets("Input - components").Range("J5").Value
    Label65.Caption = Sheets("Input - components").Range("K5").Value
    Label66.Caption = Sheets("Input - components").Range("L5").Value
 
    If Sheets("Input - components").Range("D5").Value = "" Then
        Call SetTB(37, 69, False)
    Else
        Call SetTB(37, 69, True)
    End If
    If Sheets("Input - components").Range("E5").Value = "" Then
        Call SetTB(70, 102, False)
    Else
        Call SetTB(70, 102, True)
    End If
    If Sheets("Input - components").Range("F5").Value = "" Then
        Call SetTB(103, 135, False)
    Else
        Call SetTB(103, 135, True)
    End If
    If Sheets("Input - components").Range("G5").Value = "" Then
        Call SetTB(136, 168, False)
    Else
        Call SetTB(136, 168, True)
    End If
    If Sheets("Input - components").Range("H5").Value = "" Then
        Call SetTB(169, 201, False)
    Else
        Call SetTB(169, 201, True)
    End If
    If Sheets("Input - components").Range("I5").Value = "" Then
        Call SetTB(202, 234, False)
    Else
        Call SetTB(202, 234, True)
    End If
    If Sheets("Input - components").Range("J5").Value = "" Then
        Call SetTB(235, 267, False)
    Else
        Call SetTB(235, 267, True)
    End If
    If Sheets("Input - components").Range("K5").Value = "" Then
        Call SetTB(268, 300, False)
    Else
        Call SetTB(268, 300, True)
    End If
    If Sheets("Input - components").Range("L5").Value = "" Then
        Call SetTB(301, 333, False)
    Else
        Call SetTB(301, 333, True)
    End If
End Sub
Private Sub CommandButton4_Click()
    Input4_services_data_1_10.Hide
    Input3_package_data_11_20.Show
End Sub
Private Sub CommandButton3_Click()
    Input4_services_data_1_10.Hide
    Input2_package_data_1_10.Show
End Sub
Private Sub CommandButton2_Click()
    Input4_services_data_1_10.Hide
    Input6_product_data_all.Show
End Sub
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.

Forum statistics

Threads
1,223,230
Messages
6,170,883
Members
452,364
Latest member
springate

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top