![]() |
Disabling a shape object
Hi,
have created a SHAPE object, e.g. Set objbtn = .Shapes.AddFormControl(xlButtonControl, 10, 20, 30, 40) However would like it disabled by default - how can I set it to this? Thanks. |
Disabling a shape object
Untested...
Set objbtn = .Shapes.AddFormControl(xlButtonControl, 10, 20, 30, 40) objbtn.enabled = false groupie wrote: Hi, have created a SHAPE object, e.g. Set objbtn = .Shapes.AddFormControl(xlButtonControl, 10, 20, 30, 40) However would like it disabled by default - how can I set it to this? Thanks. -- Dave Peterson |
Disabling a shape object
On Aug 22, 6:49*pm, Dave Peterson wrote:
Untested... Set objbtn = .Shapes.AddFormControl(xlButtonControl, 10, 20, 30, 40) objbtn.enabled = false groupie wrote: Hi, have created a SHAPE object, e.g. Set objbtn = .Shapes.AddFormControl(xlButtonControl, 10, 20, 30, 40) However would like it disabled by default - how can I set it to this? Thanks. -- Dave Peterson Tested.... ....but it didn't work. This property is unknown. |
Disabling a shape object
Option Explicit
Sub testme() Dim objBtn As Shape With ActiveSheet Set objBtn = .Shapes.AddFormControl(xlButtonControl, 10, 20, 30, 40) objBtn.OLEFormat.Object.Enabled = False objBtn.OnAction = "'" & ThisWorkbook.Name & "'!aaa" End With End Sub Sub aaa() MsgBox "hi" End Sub ============ I usually go through the buttons collection instead of the Shapes collection. Option Explicit Sub testme() Dim objBtn As Button With ActiveSheet Set objBtn = .Buttons.Add(10, 20, 30, 40) objBtn.Enabled = False objBtn.OnAction = "'" & ThisWorkbook.Name & "'!aaa" End With End Sub Sub aaa() MsgBox "hi" End Sub It seems easier to me. (as you could tell from my initial (incorrect) guess.) groupie wrote: On Aug 22, 6:49 pm, Dave Peterson wrote: Untested... Set objbtn = .Shapes.AddFormControl(xlButtonControl, 10, 20, 30, 40) objbtn.enabled = false groupie wrote: Hi, have created a SHAPE object, e.g. Set objbtn = .Shapes.AddFormControl(xlButtonControl, 10, 20, 30, 40) However would like it disabled by default - how can I set it to this? Thanks. -- Dave Peterson Tested.... ....but it didn't work. This property is unknown. -- Dave Peterson |
All times are GMT +1. The time now is 12:00 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com