UserForm "Errors occured during load" in '97

Todd Bardoni

Well-known Member
Joined
Aug 29, 2002
Messages
3,042
I created a spreadsheet in XL 2002 that has a UserFrom. When I run the sheet in XL '97 I get a "Errors occured during load" message when trying to load the UserForm. I can't figure out why.
Code:
Sub ToggleInputBox()
    If InputForm.Visible = True Then
            InputForm.Hide
        Else
            InputForm.Show
    End If
End Sub
Code:
Private Sub UserForm_Initialize()
     TextBox1.Value = Application.UserName
     MonthlyLedger.[B4] = TextBox1.Value
End Sub
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Hi tbardoni

Whilst most code for Xl2003 will be compatible with earlier
versions, you probably have some setting there that is not supported by Xl97. For example making Userforms Modal
is not supported by Xl97. Check to see if you have a setting or control that is not avial for Xl97.
 
Upvote 0
Thanks, Ivan. I did have ShowModal=True, but I was still getting an error. So, I decided to cheat a little and put On Error Resume Next at the top of my code and now it works fine. I'll have to do a little more testing to make sure its running properly, but so far, it looks promising.

Thanks again for your help!

Todd
 
Upvote 0
You could put in conditional compilation code @ load time to test for which VBA version so that it can handle the switch from 2003 to 97 eg.

Code:
Sub Loader()
'// Lets test which System
#If VBA6 Then
    UserForm1.Show False
#Else
    UserForm1.Show
#End If

End Sub


Note: make sure you do not set System Modal in your userform control.
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,748
Members
448,989
Latest member
mariah3

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