Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default 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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default 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.
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
DoubleClick on embedded object(shape) avi Excel Programming 12 September 5th 07 08:52 PM
shape object Faraz Excel Programming 0 August 30th 07 09:28 PM
How to prevent "Changed ... Save?" Message after disabling Shape? Joe HM Excel Programming 5 August 4th 06 04:28 PM
disabling linked object before you open a file totoro Excel Discussion (Misc queries) 4 August 12th 05 06:11 PM
shape object on a userform? Alan Ibbotson Excel Programming 5 April 25th 05 01:24 PM


All times are GMT +1. The time now is 12:38 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"