Erreur indice 9 lorsque version office différente

Bonjour,

Je suis débutant en VBA, d'ailleurs je tiens à vous remercier car j'ai souvent pu me dépatouiller grâce à ce forum.

Dans le cadre de mon travail j'ai réalisé un userform (windows 7 32 bits; office 2013).

Il fonctionne très bien sur mon PC. En revanche sur le PC de mes collègues (windows10 office 2016; windows7 office 2016), j'ai un message d'erreur indice 9.

Sauf sur le pc d'un troisième collègue (windows 7 64 bits office 2013) où là le fichier fonctionne.

Y a t il une incompatibilité entre ces différentes versions?

Je vous transmets mon fichier.

Merci

10calcul-vt20.xlsm (139.74 Ko)

Bonjour,

Dans le code de l'UserForm, remplace la procédure "Initialize()" par celle-ci et ça marchera :

Private Sub UserForm_initialize()

    Sheets("BD").Range("B16") = TextBox1.Value
    Sheets("BD").Range("B17") = TextBox2.Value
    Sheets("BD").Range("B18") = TextBox3.Value
    Sheets("BD").Range("B19") = TextBox4.Value

End Sub

Bonjour

un peux de ménage

Dim Sh As Object

Private Sub UserForm_initialize()
Set Sh = Sheets("BD")
'    Sh.Range("B16") = TextBox1.Value
'    Sh.Range("B17") = TextBox2.Value
'    Sh.Range("B18") = TextBox3.Value
'    Sh.Range("B19") = TextBox4.Value
End Sub

Private Sub CommandButton1_Click()
Dim TIME As Date
Dim heure As Date
Dim Val As String
    Sh.Range("B16") = TextBox1.Value
    Sh.Range("B17") = TextBox2.Value
    Sh.Range("B18") = TextBox3.Value
    Sh.Range("B19") = TextBox4.Value
Val = Sh.Range("B26")
    If Sh.Range("B26").Value <> "CONTACTER SUPERVISEUR" Then
        TIME = Sh.Range("B26")
        heure = Format(TIME, "hh:mm")
        MsgBox heure
    Else
        MsgBox Val
    End If
End Sub

A+

Maurice

Parfait

Merci

Rechercher des sujets similaires à "erreur indice lorsque version office differente"