Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default How can the caption of a (button) shape (not cmd) be changed from VBA

On Excel worksheets I use the button shape from the Forms toolbar and assign
macros.

Properties exist such as Name and AlternativeText but I am unable to find a
way to change what the user sees from VBA. There is no text, caption,
label, etc. property.

Since it can be edited manually it must be changeable from code, although it
may require Windows API to accomplish it.

Any suggestions?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default How can the caption of a (button) shape (not cmd) be changed from

The easiest solution (IMO) would be to change your buttons from Forms buttons
(shapes) to Control Toolbox Buttons (actual buttons with properties and
methods). These buttons are easy to reference and have the all of the
properties you require. It will be a bit of work, but it should not be too
bad. The Code for these buttons will be embedded right in the sheet. You just
need to add one line of code for each button to call your macros...

--
HTH...

Jim Thomlinson


"AnExpertNovice" wrote:

On Excel worksheets I use the button shape from the Forms toolbar and assign
macros.

Properties exist such as Name and AlternativeText but I am unable to find a
way to change what the user sees from VBA. There is no text, caption,
label, etc. property.

Since it can be edited manually it must be changeable from code, although it
may require Windows API to accomplish it.

Any suggestions?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How can the caption of a (button) shape (not cmd) be changed from

ActiveSheet.Shapes("nameofshape").Characters.text = "Your Text Here"

Nathaniel

"AnExpertNovice" wrote:

On Excel worksheets I use the button shape from the Forms toolbar and assign
macros.

Properties exist such as Name and AlternativeText but I am unable to find a
way to change what the user sees from VBA. There is no text, caption,
label, etc. property.

Since it can be edited manually it must be changeable from code, although it
may require Windows API to accomplish it.

Any suggestions?



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default How can the caption of a (button) shape (not cmd) be changed f

What is VBA anyway?

"Jim Thomlinson" wrote:

The easiest solution (IMO) would be to change your buttons from Forms buttons
(shapes) to Control Toolbox Buttons (actual buttons with properties and
methods). These buttons are easy to reference and have the all of the
properties you require. It will be a bit of work, but it should not be too
bad. The Code for these buttons will be embedded right in the sheet. You just
need to add one line of code for each button to call your macros...

--
HTH...

Jim Thomlinson


"AnExpertNovice" wrote:

On Excel worksheets I use the button shape from the Forms toolbar and assign
macros.

Properties exist such as Name and AlternativeText but I am unable to find a
way to change what the user sees from VBA. There is no text, caption,
label, etc. property.

Since it can be edited manually it must be changeable from code, although it
may require Windows API to accomplish it.

Any suggestions?



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default How can the caption of a (button) shape (not cmd) be changed from

Nathaniel,

Thanks! Possibly because I'm using Excel 2002 the format actually turned
out to be.
ActiveSheet.Shapes("nameofshape").TextFrame.Charac ters.Text =
"testing"
But that minor change was easy with your help.


Jim,

Thanks for responding, but having code embedded in the worksheet rather than
a module is exactly what I prefer to avoid



"Nathaniel Gibson" <Nathaniel wrote in
message ...
ActiveSheet.Shapes("nameofshape").Characters.text = "Your Text Here"

Nathaniel

"AnExpertNovice" wrote:

On Excel worksheets I use the button shape from the Forms toolbar and

assign
macros.

Properties exist such as Name and AlternativeText but I am unable to

find a
way to change what the user sees from VBA. There is no text, caption,
label, etc. property.

Since it can be edited manually it must be changeable from code,

although it
may require Windows API to accomplish it.

Any suggestions?







  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default How can the caption of a (button) shape (not cmd) be changed f

Visual Basic for Application. A very nice programming language. The
simplest use would be for creating user functions. A more complex use would
be for manipulating another application such as Access or Outlook.

--
My handle should tell you enough about me. I am not an MVP, expert, guru,
etc. but I do like to help.


"Gee-off" wrote in message
...
What is VBA anyway?

"Jim Thomlinson" wrote:

The easiest solution (IMO) would be to change your buttons from Forms

buttons
(shapes) to Control Toolbox Buttons (actual buttons with properties and
methods). These buttons are easy to reference and have the all of the
properties you require. It will be a bit of work, but it should not be

too
bad. The Code for these buttons will be embedded right in the sheet. You

just
need to add one line of code for each button to call your macros...

--
HTH...

Jim Thomlinson


"AnExpertNovice" wrote:

On Excel worksheets I use the button shape from the Forms toolbar and

assign
macros.

Properties exist such as Name and AlternativeText but I am unable to

find a
way to change what the user sees from VBA. There is no text, caption,
label, etc. property.

Since it can be edited manually it must be changeable from code,

although it
may require Windows API to accomplish it.

Any suggestions?





  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default How can the caption of a (button) shape (not cmd) be changed f

Thank you.

"AnExpertNovice" wrote:

Visual Basic for Application. A very nice programming language. The
simplest use would be for creating user functions. A more complex use would
be for manipulating another application such as Access or Outlook.

--
My handle should tell you enough about me. I am not an MVP, expert, guru,
etc. but I do like to help.


"Gee-off" wrote in message
...
What is VBA anyway?

"Jim Thomlinson" wrote:

The easiest solution (IMO) would be to change your buttons from Forms

buttons
(shapes) to Control Toolbox Buttons (actual buttons with properties and
methods). These buttons are easy to reference and have the all of the
properties you require. It will be a bit of work, but it should not be

too
bad. The Code for these buttons will be embedded right in the sheet. You

just
need to add one line of code for each button to call your macros...

--
HTH...

Jim Thomlinson


"AnExpertNovice" wrote:

On Excel worksheets I use the button shape from the Forms toolbar and

assign
macros.

Properties exist such as Name and AlternativeText but I am unable to

find a
way to change what the user sees from VBA. There is no text, caption,
label, etc. property.

Since it can be edited manually it must be changeable from code,

although it
may require Windows API to accomplish it.

Any suggestions?






  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default How can the caption of a (button) shape (not cmd) be changed from VBA

If it is a button from the forms toolbar, it does have a caption property.
However, you have to treat it as a button to use it. If you want to treat
it as a shape:

ActiveSheet.Shapes("Button 1").TextFrame.Characters.Text = "ABCD"


but as a button it is

ActiveSheet.buttons("Button 1").Caption = "ABCDEF"


A button is a hidden object in the object browser, so if you right click on
the browser and select show hidden members, you will be able to see the
properties.

Unlike Jim, unless there are special properties you need to work with, I
don't see any reason to go to control toobox toolbar commandbuttons.

--
Regards,
Tom Ogilvy



"AnExpertNovice" wrote in message
...
On Excel worksheets I use the button shape from the Forms toolbar and

assign
macros.

Properties exist such as Name and AlternativeText but I am unable to find

a
way to change what the user sees from VBA. There is no text, caption,
label, etc. property.

Since it can be edited manually it must be changeable from code, although

it
may require Windows API to accomplish it.

Any suggestions?




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
CURSOR SHAPE HAS CHANGED Weep Excel Discussion (Misc queries) 3 March 6th 10 08:30 PM
Can Multiple Range Pivot Table's field button's caption be changed Jac Excel Discussion (Misc queries) 1 June 10th 07 11:09 AM
my curser changed from arrow shape to a cross shape???? bj New Users to Excel 1 February 5th 07 02:47 PM
Cell comment boxes shouldn't change size/shape unless changed by u sam Excel Discussion (Misc queries) 1 March 3rd 05 05:23 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 01:06 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"