Variable globale entre 2 userforms
Bonjour a tous,
J'ai un problème vraiment étrange; je m'explique:
J'ai créer une variable globale dans une méthode destinée à cela:
VariableGlobal
Code:
Public SimuPath as String
Dans mon premier userfom qui s'ouvre à l'ouverture, je modifie cette variable:
Thisworkbook
Code:
1 2 3
| Private Sub Workbook_Open()
FORM1.SHOW
end Sub |
FORM1
Code:
1 2 3 4 5 6 7
| Option Explicit
Private Sub cmdbut_Click()
SimuPath = "C:\"
Application.WindowState = xlMinimized
FORM2.Show
end Sub |
et la dans la feuille 2
FORM2
Code:
1 2 3
| Private Sub Userform_Initialize()
msgbox SimuPath
end sub |
et sa me donne VIDE tout le temps.
Merci a tous
Bastien