Sub centrer_le_text(obj As Object)
Dim barre, bout, shap
Set barre = Application.CommandBars.Add("tempo", msoBarPopup, , True)
Set bout = barre.Controls.Add(Type:=msoControlButton)
Set shap = ActiveSheet.Shapes.AddShape(msoShapeRectangle, 0, 0, 1, 1)
With shap
.Line.Visible = msoFalse
.Fill.Visible = msoFalse
.CopyPicture 'copypicture=copie en WMF(garde la transparence)
.Delete
End With
bout.PasteFace
With Label1
.Picture = bout.Picture
.PicturePosition = fmPicturePositionCenter
End With
barre.Delete
End Sub