Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default setting the caption in a button control

After entering the following line:
Set btn = ActiveSheet.Shapes.AddFormControl(xlButtonControl, 160, 28, 75,
23)

I try to change the caption by using

btn.Caption = "caption"

I receive an error when the code runs. What am I doing wrong? How can I
get this to work?

TIA

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default setting the caption in a button control

Andy,

Try... btn.TextFrame.Characters.Text = "Caption"

Jim Cone
San Francisco, USA

"Andy Dorph" wrote in message
...
After entering the following line:
Set btn = ActiveSheet.Shapes.AddFormControl(xlButtonControl, 160, 28, 75, 23)
I try to change the caption by using
btn.Caption = "caption"
I receive an error when the code runs. What am I doing wrong? How can I
get this to work?
TIA


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default setting the caption in a button control

That didn't work for me. Perhaps:

Sub Tester3()
Set btn = ActiveSheet.Shapes.AddFormControl(xlButtonControl, 160, 28, 75,
23)
ActiveSheet.Buttons(btn.Name).Caption = "Hi There"
End Sub

which did work.

--
Regards,
Tom Ogilvy


"Don Guillett" wrote in message
...
try
btn.Characters.Text = "Hi There"

--
Don Guillett
SalesAid Software

"Andy Dorph" wrote in message
...
After entering the following line:
Set btn = ActiveSheet.Shapes.AddFormControl(xlButtonControl, 160, 28,

75,
23)

I try to change the caption by using

btn.Caption = "caption"

I receive an error when the code runs. What am I doing wrong? How can

I
get this to work?

TIA





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default setting the caption in a button control

Jim:

Thank you. It worked.

"Jim Cone" wrote:

Andy,

Try... btn.TextFrame.Characters.Text = "Caption"

Jim Cone
San Francisco, USA

"Andy Dorph" wrote in message
...
After entering the following line:
Set btn = ActiveSheet.Shapes.AddFormControl(xlButtonControl, 160, 28, 75, 23)
I try to change the caption by using
btn.Caption = "caption"
I receive an error when the code runs. What am I doing wrong? How can I
get this to work?
TIA



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
Change caption of a button Dylan @ UAFC[_2_] Excel Worksheet Functions 3 November 25th 08 07:04 PM
Caption control on shapes RobN[_2_] Excel Discussion (Misc queries) 4 April 12th 08 01:47 AM
Change caption on a macro button gbeard Excel Worksheet Functions 3 April 21st 05 01:43 PM
Option button caption Buce Roberson Excel Programming 1 August 26th 04 02:58 PM
Caption of a button Dr_Phil Excel Programming 4 May 4th 04 09:13 PM


All times are GMT +1. The time now is 10:49 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"