G essayer ton instruction, il ne se passe rien.
G reessayer avec la petite procé écrite plus haut, et maintenant ca marche, g trouver le prob.
Par contre, rien à faire pour celle-ci, si qq'un peux la tester et me dire pq elle marche pas (elle est censée m'opuvrir et me fermer une barre d'outil avec un fichier), ce serait sympa, thx d'avance.
Public barre_d_outils As Object
Private Sub Workbook_Open()
For Each bar In Application.CommandBars
If bar.Name = "Gestion" Then
Exit Sub
End If
Next
Set barre_perso = Application.CommandBars.Add(Name:="Gestion", Position:=msoBarFloating, MenuBar:=False, Temporary:=True)
With barre_perso
.Visible = True
.Left = 440
.Top = 150
.Controls.Add Type:=msoControlButton, ID:=1017
.Controls.Add Type:=msoControlButton, ID:=860
.Controls.Add Type:=msoControlButton, ID:=178
.Controls.Add Type:=msoControlButton, ID:=4
.Controls.Add Type:=msoControlButton, ID:=893
End With
With barre_perso.Controls(1)
.Caption = "Revenir au formulaire"
.Enabled = True
.Visible = True
.OnAction = "Précédent"
End With
With barre_perso.Controls(2)
.Visible = True
End With
barre_perso.Controls(4).Caption = "impression"
barre_perso.Controls(5).Caption = "Activer"
On Error Resume Next
ActiveSheet.Select
End Sub
Sub Workbook_beforeClose(cancel As Boolean)
On Error Resume Next
If Workbooks.Count = 2 Then
Application.CommandBars("Gestion").Delete
End If
End Sub