J'ai un bouton pour lancer une macro.
La 1ere partie:
fonctionne à merveille.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6 Sub creation_projet_Click() Application.Run "'Estimations.xlsm'!projet_new" indexation.Show End Sub
Maintenant, le code pour le formulaire "indexation":
refuse maintenant de lancer la macro "indexation". Je ne comprends pas, tout fonctionnaire en début de semaine...
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30 Option Explicit Private Sub CommandButton1_Click() Call UserForm_Initialize End Sub Private Sub OK_Click() Sheets("nouveau projet").Activate Cells.Item(1, 1) = nom_projet.Text Cells.Item(5, 2) = no_projet.Text Cells.Item(1, 4) = client.Text Cells.Item(1, 10) = adresse.Text Cells.Item(2, 10) = ville.Text Cells.Item(3, 10) = code_postal.Text Cells.Item(4, 10) = tel.Text Cells.Item(5, 10) = telec.Text Cells.Item(6, 10) = email.Text If OptionReservoir Then Cells.Item(7, 2) = "Réservoir" If OptionPF Then Cells.Item(7, 2) = "Plate-forme" If OptionPFA Then Cells.Item(7, 2) = "Plate-forme et abri" Range("C10").Activate Application.Run "'Estimations.xlsm'!indexation" Unload Me End Sub Private Sub Cancel_Click() Unload Me End Sub
Le code du bouton est situé dans "MS Excel Objects", le code du formulaire dans "indexation", et les macros dans différents modules, tous rattachés au même fichier, Estimation (Estimations.xlsm).
Est-ce parce que j'ai un formulaire du même nom qu'une macro?
Partager