Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
DoubleClick on embedded object(shape) | Excel Programming | |||
shape object | Excel Programming | |||
How to prevent "Changed ... Save?" Message after disabling Shape? | Excel Programming | |||
disabling linked object before you open a file | Excel Discussion (Misc queries) | |||
shape object on a userform? | Excel Programming |