I have built a VBA project in Excel for one of my customers to help him gather some inputs on time spent by his employees on different activities. Each employee has a dedicated file for there personal use.

In order to complete the file, the first step is for each user to enter their personal information in a userform (such as Name, Team, etc..). When activated, the userform is either empty (first use), or already completed with the information entered by the employee during previous usage of the file. These information are stored in a worksheet name "infos".

The userform is made of :

  • textboxes taking the values of specific cells in the "infos" worksheet;
  • a combobox showing the names of the existing teams (from the worksheet "Paramètres"), in order for the user to select one.

I never experienced the problem on my computer, but when loading the userform some employees have experienced the error mentioned in the Title of this post.

Could you please help me to understand what might explain that for some users it works perfectly, but for some of them it is impossible to open the userform due to that error?

Here is the userform activation code :

Private Sub Userform_Activate()

Dim Inf As Worksheet
Dim Pr As Worksheet
Dim i As Integer

Set Inf = Worksheets("Infos")
Set Pr = Worksheets("Paramètres")

Application.ScreenUpdating = False

Set Inf = Worksheets("Infos")

Inf.Visible = True

For i = 1 To 7
    Informations_personnelles.Controls("Info" & i).Value = Sheets("Infos").Range("E" & i * 2 + 3)
Next

Pr.Visible = True

Informations_personnelles.Controls("Info4").Value = Inf.Range("E11").Value

Do While Informations_personnelles.Controls("Info4").ListCount > 0
    Informations_personnelles.Controls("Info4").RemoveItem (0)
Loop

For i = 4 To Pr.Range("F" & Application.Rows.Count).End(xlUp).Row
    If Pr.Range("F" & i).Value = "Equipe" Then
        Informations_personnelles.Controls("Info4").AddItem Pr.Range("G" & i)
    End If
Next i

Pr.Visible = False
Inf.Visible = False

End Sub

I have tried to find the origin of the issue, but since I am not experiencing the error myself, it is hard to see where that might come from.

Thank you very much for your precious help!

0

There are 0 best solutions below