Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Removing Command Button

I am having a terrible time getting my command buttons to
work.

It does not seem to even recognize my Click event.

Sub A()

ActiveSheet.OLEObjects.Add
(ClassType:="Forms.CommandButton.1", Link:=False _
, DisplayAsIcon:=False, Left:=300, Top:=250,
Width:=125, Height:= _
50).Select

ActiveSheet.OLEObjects("CommandButton1").Object.Ca ption
= "Run Me"

End Sub

Sub CommandButton1_Click()
ActiveSheet.OLEObjects("CommandButton1").Object.Vi sible =
False
End Sub

Any Suggestions?

Thanks

SS
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Removing Command Button

Is the click event code in the worksheet code module.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"SS" wrote in message
...
I am having a terrible time getting my command buttons to
work.

It does not seem to even recognize my Click event.

Sub A()

ActiveSheet.OLEObjects.Add
(ClassType:="Forms.CommandButton.1", Link:=False _
, DisplayAsIcon:=False, Left:=300, Top:=250,
Width:=125, Height:= _
50).Select

ActiveSheet.OLEObjects("CommandButton1").Object.Ca ption
= "Run Me"

End Sub

Sub CommandButton1_Click()
ActiveSheet.OLEObjects("CommandButton1").Object.Vi sible =
False
End Sub

Any Suggestions?

Thanks

SS



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
command button add another command Wanna Learn Excel Discussion (Misc queries) 5 December 7th 08 11:42 PM
Command Button Paul Excel Discussion (Misc queries) 1 April 4th 08 12:00 PM
Command Button vs Control Button RGibson Excel Programming 1 October 14th 03 02:24 AM
Command Button vs Form Button T K Excel Programming 4 August 26th 03 07:26 PM
Removing Picture from Cell Command Bar Bernie Deitrick[_2_] Excel Programming 0 August 8th 03 02:59 PM


All times are GMT +1. The time now is 01:21 PM.

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

About Us

"It's about Microsoft Excel"