Bonjour,

j'essaye d'ajouter une textbox à un de mes graphes...

J'ai principalement deux problèmes.
  1. Comment contrôler le nom de la textbox ?
  2. Comment changer la couleur de fond de ma textbox ?


Pour l'instant, j'ai le code suivant (qui fonctionne) :


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
With ActiveSheet.ChartObjects("Chart 1").Chart.Shapes.AddTextbox(msoTextOrientationHorizontal, 233.5, 100, 50, 20)
 
With .TextFrame
.AutoSize = msoTrue
.Characters.Text = ActiveSheet.Range("D70").Value ' Preferred operating region
With .Characters(Start:=1, Length:=55).Font
.Name = "Arial"
.FontStyle = "Regular"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = 5 ' blue
End With
End With
End With
J'essaye d'inclure une ligne du genre

.ForeColor.RGB = RGB(250,0,0)

mais sans succès...

Merci à ceux qui m'aideront.

RM