X
Xavier
Guest
Bonjour,
J'aimerais introduire deux boutons sur une feuille que j'ai crée ainsi qu'un combobox sur la meme feuille .... comme je suis ignorant ou fainéant, j'utilise pour ce faire l'enregistreur macro et ensuite j'introduis la copie dans mon fichier de base. Malheureusement pour moi, ca ne fonctionne pas ... il me parle de Method "Select" of Objet shape failed ... ce qui est assez génant
Pouvez vous m'aidez svp? merci bcp
XA
Voici le code que j'utilise
Application.CommandBars("Control Toolbox").Visible = True
ActiveSheet.OLEObjects.Add(ClassType:="Forms.CommandButton.1", Link:=False _
, DisplayAsIcon:=False, Left:=623.25, Top:=12.75, Width:=72, Height:= _
24).Select
ActiveSheet.OLEObjects.Add(ClassType:="Forms.CommandButton.1", Link:=False _
, DisplayAsIcon:=False, Left:=624, Top:=51, Width:=72, Height:=24). _
Select
ActiveSheet.OLEObjects.Add(ClassType:="Forms.ComboBox.1", Link:=False, _
DisplayAsIcon:=False, Left:=18, Top:=13.5, Width:=72, Height:=18). _
Select
' ca foire ici
ActiveSheet.Shapes("CommandButton1").Select
ActiveSheet.Shapes("CommandButton2").Select
Selection.ShapeRange.ScaleWidth 1.16, msoFalse, msoScaleFromBottomRight
Range("M3").Select
ActiveSheet.Shapes("Global_TOP").Select
Selection.ShapeRange.ScaleWidth 1.14, msoFalse, msoScaleFromBottomRight
Selection.ShapeRange.IncrementLeft 24.75
Selection.ShapeRange.IncrementTop 0.75
ActiveSheet.Shapes("Global_Down").Select
Selection.ShapeRange.IncrementLeft 23.25
ActiveSheet.Shapes("ComboBox1").Select
Selection.ShapeRange.IncrementLeft -9.75
Selection.ShapeRange.IncrementTop 6.75
J'aimerais introduire deux boutons sur une feuille que j'ai crée ainsi qu'un combobox sur la meme feuille .... comme je suis ignorant ou fainéant, j'utilise pour ce faire l'enregistreur macro et ensuite j'introduis la copie dans mon fichier de base. Malheureusement pour moi, ca ne fonctionne pas ... il me parle de Method "Select" of Objet shape failed ... ce qui est assez génant
Pouvez vous m'aidez svp? merci bcp
XA
Voici le code que j'utilise
Application.CommandBars("Control Toolbox").Visible = True
ActiveSheet.OLEObjects.Add(ClassType:="Forms.CommandButton.1", Link:=False _
, DisplayAsIcon:=False, Left:=623.25, Top:=12.75, Width:=72, Height:= _
24).Select
ActiveSheet.OLEObjects.Add(ClassType:="Forms.CommandButton.1", Link:=False _
, DisplayAsIcon:=False, Left:=624, Top:=51, Width:=72, Height:=24). _
Select
ActiveSheet.OLEObjects.Add(ClassType:="Forms.ComboBox.1", Link:=False, _
DisplayAsIcon:=False, Left:=18, Top:=13.5, Width:=72, Height:=18). _
Select
' ca foire ici
ActiveSheet.Shapes("CommandButton1").Select
ActiveSheet.Shapes("CommandButton2").Select
Selection.ShapeRange.ScaleWidth 1.16, msoFalse, msoScaleFromBottomRight
Range("M3").Select
ActiveSheet.Shapes("Global_TOP").Select
Selection.ShapeRange.ScaleWidth 1.14, msoFalse, msoScaleFromBottomRight
Selection.ShapeRange.IncrementLeft 24.75
Selection.ShapeRange.IncrementTop 0.75
ActiveSheet.Shapes("Global_Down").Select
Selection.ShapeRange.IncrementLeft 23.25
ActiveSheet.Shapes("ComboBox1").Select
Selection.ShapeRange.IncrementLeft -9.75
Selection.ShapeRange.IncrementTop 6.75