LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How can I programatically change the caption on a button?

Microsoft Excel 2003


I have created a button on a spreadsheet using the following code

ActiveSheet.OLEObjects.Add(ClassType:="Forms.Comma ndButton.1",
Link:=False _
, DisplayAsIcon:=False, Left:=147, Top:=27.75, Width:=145.5,
Height:= _
33).Select
ActiveSheet.Shapes("CommandButton1").Name = "cmdButton"

but when I try and set a caption for the button using:
ActiveSheet.Shapes("CommandButton1").caption = "Hello World" it tells me
that the
"Object doesn't support this object or method"

When I try and record a macro to change the caption I end up with:
ActiveSheet.Shapes("CommandButton1").Select
Selection.Verb Verb:=xlPrimary

which frankly, I don't understand.

Can anyone help me here and tell me how to apply a caption to my button.


Many thanks


June


 
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
Change caption of a button Dylan @ UAFC[_2_] Excel Worksheet Functions 3 November 25th 08 07:04 PM
using vba to change command button caption PaulaO Excel Programming 2 April 5th 06 07:35 PM
Change Caption of Button Alexander Excel Programming 3 August 17th 05 04:45 PM
How to change Button Caption? BrianB Excel Programming 3 June 1st 05 06:24 PM
Change caption on a macro button gbeard Excel Worksheet Functions 3 April 21st 05 01:43 PM


All times are GMT +1. The time now is 06:06 AM.

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"