VBA Modifier Propriété Shape - Macros et VBA Excel (2025)

  • Forum
  • Logiciels
  • Microsoft Office
  • Excel
  • Macros et VBA Excel
  • VBA Modifier Propriété Shape

+ Répondre à la discussion

VBA Modifier Propriété Shape - Macros et VBA Excel (2) Discussion :

Sujet :

Macros et VBA Excel

  • Outils de la discussion
    • Afficher une version imprimable
    • S'abonner à cette discussion…
  • Affichage
    • Choisir le mode hybride
    • Choisir le mode arborescent
  1. 23/06/2017,10h34#1

    frto0

    VBA Modifier Propriété Shape - Macros et VBA Excel (3)

    Membre avertiVBA Modifier Propriété Shape - Macros et VBA Excel (4)VBA Modifier Propriété Shape - Macros et VBA Excel (5)VBA Modifier Propriété Shape - Macros et VBA Excel (6)VBA Modifier Propriété Shape - Macros et VBA Excel (7)VBA Modifier Propriété Shape - Macros et VBA Excel (8)VBA Modifier Propriété Shape - Macros et VBA Excel (9)VBA Modifier Propriété Shape - Macros et VBA Excel (10)VBA Modifier Propriété Shape - Macros et VBA Excel (11)

    Inscrit en
    Avril 2010
    Messages
    43

    VBA Modifier Propriété Shape - Macros et VBA Excel (12)

    VBA Modifier Propriété Shape - Macros et VBA Excel (13) VBA Modifier Propriété Shape

    Bonjour,

    Dans une fenêtre vérrouillée, je crée des shapes que l'utilisateur peut être amené à bouger.
    Vu que la feuille est vérouillée, il faut que les propritées "Vérrouillé" et "Text Vérouillé" soit désactivées pour pouvoir faire ce que je veux.

    VBA Modifier Propriété Shape - Macros et VBA Excel (14)

    Dans le code j'arrive bien a travaillé sur mon élément, par contre je ne vois pas comment accéder aux propriétés "Vérrouillé" et "Text Vérouillé"

    Code :Sélectionner tout -Visualiser dans une fenêtre à part

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13

    f.Shapes(NomShape).Fill.ForeColor.RGB = RGB(221, 217, 195) f.Shapes(NomShape).TextFrame.Characters.Text = TextVrai f.Shapes(NomShape).TextFrame.Characters(Start:=1, Length:=LongText).Font.Bold = False f.Shapes(NomShape).TextFrame.Characters(Start:=1, Length:=LongText).Font.Color = RGB(0, 0, 0) f.Shapes(NomShape).TextFrame.Characters(Start:=1, Length:=LongText).Font.Size = 12 'Dimmensionnement en point f.Shapes(NomShape).Height = 14 f.Shapes(NomShape).Width = 50 'On repositionne à la place par défaut car pas de bouton à gérer f.Shapes(NomShape).Top = ValTop f.Shapes(NomShape).Left = ValLeft
    Merci

    Répondre avec citation 0 0

  2. 23/06/2017,10h49#2

    jerome.vaussenat

    VBA Modifier Propriété Shape - Macros et VBA Excel (16)

    Membre ExpertVBA Modifier Propriété Shape - Macros et VBA Excel (17)VBA Modifier Propriété Shape - Macros et VBA Excel (18)VBA Modifier Propriété Shape - Macros et VBA Excel (19)VBA Modifier Propriété Shape - Macros et VBA Excel (20)VBA Modifier Propriété Shape - Macros et VBA Excel (21)VBA Modifier Propriété Shape - Macros et VBA Excel (22)VBA Modifier Propriété Shape - Macros et VBA Excel (23)VBA Modifier Propriété Shape - Macros et VBA Excel (24)

    VBA Modifier Propriété Shape - Macros et VBA Excel (26) VBA Modifier Propriété Shape - Macros et VBA Excel (27) VBA Modifier Propriété Shape - Macros et VBA Excel (28)

    Formateur Bureautique

    Inscrit en
    Janvier 2011
    Messages
    1629

    VBA Modifier Propriété Shape - Macros et VBA Excel (29)

    VBA Modifier Propriété Shape - Macros et VBA Excel (30)

    Salut,

    Pour ce qui est de la protection (code obtenu avec l'enregistreur de macro.

    Code :Sélectionner tout -Visualiser dans une fenêtre à part
    ActiveSheet.Shapes("Rectangle 3").Locked = msoFalse
    on remplace le msoFalse par msoTrue pour activer la protection.

    En espérant que cela t'aidera.

    Répondre avec citation 0 0

  3. 23/06/2017,10h49#3

    Jean-Philippe André

    VBA Modifier Propriété Shape - Macros et VBA Excel (32)

    Rédacteur/Modérateur

    VBA Modifier Propriété Shape - Macros et VBA Excel (33)VBA Modifier Propriété Shape - Macros et VBA Excel (34)VBA Modifier Propriété Shape - Macros et VBA Excel (35)VBA Modifier Propriété Shape - Macros et VBA Excel (36)VBA Modifier Propriété Shape - Macros et VBA Excel (37)VBA Modifier Propriété Shape - Macros et VBA Excel (38)VBA Modifier Propriété Shape - Macros et VBA Excel (39)VBA Modifier Propriété Shape - Macros et VBA Excel (40)

    VBA Modifier Propriété Shape - Macros et VBA Excel (41) VBA Modifier Propriété Shape - Macros et VBA Excel (42) VBA Modifier Propriété Shape - Macros et VBA Excel (43) VBA Modifier Propriété Shape - Macros et VBA Excel (44)
    VBA Modifier Propriété Shape - Macros et VBA Excel (45) VBA Modifier Propriété Shape - Macros et VBA Excel (46) VBA Modifier Propriété Shape - Macros et VBA Excel (47)

    VBA Modifier Propriété Shape - Macros et VBA Excel (49) VBA Modifier Propriété Shape - Macros et VBA Excel (50) VBA Modifier Propriété Shape - Macros et VBA Excel (51)

    Architecte Power Platform, ex-Développeur VBA/C#/VB.Net

    Inscrit en
    Juillet 2007
    Messages
    14681

    VBA Modifier Propriété Shape - Macros et VBA Excel (52)

    VBA Modifier Propriété Shape - Macros et VBA Excel (53)

    SAlut,

    en utilisant l'enregistreur de macro et en extrapolant je trouve ceci :

    Code :Sélectionner tout -Visualiser dans une fenêtre à part

    1
    2
    3

    Selection.PrintObject = msoFalse 'msoTrueSelection.Locked = msoFalseSelection.LockedText = msoTrue

    Cycle de vie d'un bon programme :
    1/ ça fonctionne 2/ ça s'optimise 3/ ça se refactorise

    Pas de question technique par MP, je ne réponds pas VBA Modifier Propriété Shape - Macros et VBA Excel (54)

    Mes ouvrages :
    Migrer les applications VBA Access et VBA Excel vers la Power Platform
    Apprendre à programmer avec Access 2016, Access 2019 et 2021

    Apprendre à programmer avec VBA Excel
    Prise en main de Dynamics 365 Business Central

    Coffrets disponibles de mes ouvrages : https://www.editions-eni.fr/jean-philippe-andre
    Pensez à consulter la FAQ Excel et la FAQ Access

    Derniers tutos
    Excel et les paramètres régionaux
    Les fichiers Excel binaires : xlsb,

    Autres tutos

    Répondre avec citation 0 0

  4. 23/06/2017,13h42#4

    frto0

    VBA Modifier Propriété Shape - Macros et VBA Excel (56)

    Membre avertiVBA Modifier Propriété Shape - Macros et VBA Excel (57)VBA Modifier Propriété Shape - Macros et VBA Excel (58)VBA Modifier Propriété Shape - Macros et VBA Excel (59)VBA Modifier Propriété Shape - Macros et VBA Excel (60)VBA Modifier Propriété Shape - Macros et VBA Excel (61)VBA Modifier Propriété Shape - Macros et VBA Excel (62)VBA Modifier Propriété Shape - Macros et VBA Excel (63)VBA Modifier Propriété Shape - Macros et VBA Excel (64)

    Inscrit en
    Avril 2010
    Messages
    43

    VBA Modifier Propriété Shape - Macros et VBA Excel (65)

    VBA Modifier Propriété Shape - Macros et VBA Excel (66)

    Merci pour vos réponses :
    Pour Selection.Locked = msoFalse, c'est OK par contre les 2 autres ça ne change rien.

    J'ai bien essayé de faire les manips avec l'enregistreur de Macro comme vous avez fait, mais rien de ce que je modifie en objet est enregistré.
    Est que vous savez si c'est une option qq part?

    Répondre avec citation 0 0

  5. 23/06/2017,14h01#5

    Jean-Philippe André

    VBA Modifier Propriété Shape - Macros et VBA Excel (68)

    Rédacteur/Modérateur

    VBA Modifier Propriété Shape - Macros et VBA Excel (69)VBA Modifier Propriété Shape - Macros et VBA Excel (70)VBA Modifier Propriété Shape - Macros et VBA Excel (71)VBA Modifier Propriété Shape - Macros et VBA Excel (72)VBA Modifier Propriété Shape - Macros et VBA Excel (73)VBA Modifier Propriété Shape - Macros et VBA Excel (74)VBA Modifier Propriété Shape - Macros et VBA Excel (75)VBA Modifier Propriété Shape - Macros et VBA Excel (76)

    VBA Modifier Propriété Shape - Macros et VBA Excel (77) VBA Modifier Propriété Shape - Macros et VBA Excel (78) VBA Modifier Propriété Shape - Macros et VBA Excel (79) VBA Modifier Propriété Shape - Macros et VBA Excel (80)
    VBA Modifier Propriété Shape - Macros et VBA Excel (81) VBA Modifier Propriété Shape - Macros et VBA Excel (82) VBA Modifier Propriété Shape - Macros et VBA Excel (83)

    VBA Modifier Propriété Shape - Macros et VBA Excel (85) VBA Modifier Propriété Shape - Macros et VBA Excel (86) VBA Modifier Propriété Shape - Macros et VBA Excel (87)

    Architecte Power Platform, ex-Développeur VBA/C#/VB.Net

    Inscrit en
    Juillet 2007
    Messages
    14681

    VBA Modifier Propriété Shape - Macros et VBA Excel (88)

    VBA Modifier Propriété Shape - Macros et VBA Excel (89)

    Bizarre, j'ai bien les cases qui se cochent et decochent...

    Quel est ton code exact stp ?

    Cycle de vie d'un bon programme :
    1/ ça fonctionne 2/ ça s'optimise 3/ ça se refactorise

    Pas de question technique par MP, je ne réponds pas VBA Modifier Propriété Shape - Macros et VBA Excel (90)

    Mes ouvrages :
    Migrer les applications VBA Access et VBA Excel vers la Power Platform
    Apprendre à programmer avec Access 2016, Access 2019 et 2021

    Apprendre à programmer avec VBA Excel
    Prise en main de Dynamics 365 Business Central

    Coffrets disponibles de mes ouvrages : https://www.editions-eni.fr/jean-philippe-andre
    Pensez à consulter la FAQ Excel et la FAQ Access

    Derniers tutos
    Excel et les paramètres régionaux
    Les fichiers Excel binaires : xlsb,

    Autres tutos

    Répondre avec citation 0 0

  6. 25/06/2017,21h23#6

    frto0

    VBA Modifier Propriété Shape - Macros et VBA Excel (92)

    Membre avertiVBA Modifier Propriété Shape - Macros et VBA Excel (93)VBA Modifier Propriété Shape - Macros et VBA Excel (94)VBA Modifier Propriété Shape - Macros et VBA Excel (95)VBA Modifier Propriété Shape - Macros et VBA Excel (96)VBA Modifier Propriété Shape - Macros et VBA Excel (97)VBA Modifier Propriété Shape - Macros et VBA Excel (98)VBA Modifier Propriété Shape - Macros et VBA Excel (99)VBA Modifier Propriété Shape - Macros et VBA Excel (100)

    Inscrit en
    Avril 2010
    Messages
    43

    VBA Modifier Propriété Shape - Macros et VBA Excel (101)

    VBA Modifier Propriété Shape - Macros et VBA Excel (102)

    Je suis d'accord c'est bizarre.
    Je suis en Excel 2007, j'ai bien vu d'autre personne confronté au pb et apparemment en 2007 l'enregistreur de Macro ne fonctionne pas sur les Shapes.

    Mon code :

    Code :Sélectionner tout -Visualiser dans une fenêtre à part

    1
    2
    3
    4
    5

    Set TmpShape = f.Shapes.AddTextbox(msoTextOrientationHorizontal, ValLeft, ValTop, 100, 40) TmpShape.Name = NomShape TmpShape.PrintObject = msoFalse 'msoTrue TmpShape.Locked = msoFalse TmpShape.LockedText = msoFalse
    Dans l'explorateur d'objet sous VBA, on ne retrouve pas la propriété LockedText alors qu'on a bien la Locked.
    VBA Modifier Propriété Shape - Macros et VBA Excel (103)

    MERCI

    Répondre avec citation 0 0

+ Répondre à la discussion

  • Forum
  • Logiciels
  • Microsoft Office
  • Excel
  • Macros et VBA Excel
  • VBA Modifier Propriété Shape

«Discussion précédente|Discussion suivante»

Discussions similaires

  1. [WD-2013][VBA] Modifier propriétés d'un autre document ouvert

    Par skyart dans le forum VBA Word

    Réponses: 2

    Dernier message: 31/03/2017, 21h01

  2. modifier en vba les propriétés d'un updown d'une feuille excel

    Par AlfredKr dans le forum Macros et VBA Excel

    Réponses: 2

    Dernier message: 18/02/2012, 12h05

  3. Modifier propriété <source base> d'une requête par VBA ou SQL?

    Par 1010titi dans le forum Requêtes et SQL.

    Réponses: 9

    Dernier message: 26/11/2008, 21h16

  4. [vba]modifier un caratère dans une string

    Par megapacman dans le forum Access

    Réponses: 1

    Dernier message: 11/04/2006, 18h12

  5. [VBA] Les propriétés de cellule dans Excel

    Par Kylen dans le forum API, COM et SDKs

    Réponses: 6

    Dernier message: 05/07/2004, 23h02

Partager

Partager
VBA Modifier Propriété Shape - Macros et VBA Excel (2025)

References

Top Articles
Latest Posts
Recommended Articles
Article information

Author: Delena Feil

Last Updated:

Views: 6128

Rating: 4.4 / 5 (65 voted)

Reviews: 88% of readers found this page helpful

Author information

Name: Delena Feil

Birthday: 1998-08-29

Address: 747 Lubowitz Run, Sidmouth, HI 90646-5543

Phone: +99513241752844

Job: Design Supervisor

Hobby: Digital arts, Lacemaking, Air sports, Running, Scouting, Shooting, Puzzles

Introduction: My name is Delena Feil, I am a clean, splendid, calm, fancy, jolly, bright, faithful person who loves writing and wants to share my knowledge and understanding with you.