VBA Application.caller error 13 run time

Fermé
Kamel - Modifié par pijaku le 2/02/2017 à 07:45
Patrice33740 Messages postés 8556 Date d'inscription dimanche 13 juin 2010 Statut Membre Dernière intervention 2 mars 2023 - 1 févr. 2017 à 23:20
Bonjour,

voici mon debut de code pour une carte interactive par contre j'ai error 13 run time

Sub Freeform124_Click()
Dim NomShape As String

NomShape = Application.Caller



For Each Shape In ActiveSheet.Shapes
form.Fill.ForeColor.RGB = RGB(0, 50, 0)
Next Shape


End Sub


quelqu'un peut m'aider

A voir également:

2 réponses

f894009 Messages postés 17185 Date d'inscription dimanche 25 novembre 2007 Statut Membre Dernière intervention 15 avril 2024 1 701
31 janv. 2017 à 08:48
Bonjour,

Je n'ai pas cette erreur mais objet requis a celle-ci
form.Fill.ForeColor.RGB = RGB(0, 50, 0)
0
Patrice33740 Messages postés 8556 Date d'inscription dimanche 13 juin 2010 Statut Membre Dernière intervention 2 mars 2023 1 775
Modifié par Patrice33740 le 1/02/2017 à 23:21
Bonjour,

1. Ne pas employer de variable nommée avec un mot du langage (For each shape in ...)
2. Tester le type de shape (tous n'ont pas une propriété Fill)

Par exemple
Sub Freeform124_Click() 
Dim shp As Shape
  For Each shp In ActiveSheet.Shapes
    If shp.Type = msoFreeform Then
      shp.Fill.ForeColor.RGB = RGB(0, 50, 0) 
    End If
  Next shp
End Sub 

Cordialement
Patrice
0