Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default Problem with command button name

Hi,

I am having a strange problem.
I have a workbook with 20 or so sheet, and on each sheet is a command
button. I have changed the default name of most of the command buttons to
better reflect its purpose, but a couple of them have been giving me
trouble.
I can change the name, and it stays that way while I have the workbook
open. But once I save the workbook, close it and then reopen it, the name
that I entered has reverted back to the default "CommandButton1". Any idea
what is going on here?

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Problem with command button name

And you're positive that you've saved the workbook?

And you're positive that you're opening the workbook that you saved?

One test if you're positive...
Open the workbook
make the changes
save the workbook
close excel

Open excel in safe mode
windows start button|run
excel /safe
file|open your workbook that was just saved

Are the commandbuttons renamed?

If no, then maybe you have a macro that's changing the names of your
commandbuttons each time you open that workbook???

If yes, I don't have a guess.

Jason wrote:

Hi,

I am having a strange problem.
I have a workbook with 20 or so sheet, and on each sheet is a command
button. I have changed the default name of most of the command buttons to
better reflect its purpose, but a couple of them have been giving me
trouble.
I can change the name, and it stays that way while I have the workbook
open. But once I save the workbook, close it and then reopen it, the name
that I entered has reverted back to the default "CommandButton1". Any idea
what is going on here?

Thanks


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default Problem with command button name

Hi Dave,

I have actually just noticed that while in Design Mode in the Properties
window the name has been changed, but in the name box it still says
CommandButton1. It's like it not properly changing the name at all!?

Also, how do you check the name of command buttons while in safe mode?
My Developer tab disappeared, and I am not able to re-add it in safe mode,
as well now, none of the names for the command buttons appear in the
name box.

On Wed, 17 Oct 2007 15:59:32 -0500, Dave Peterson wrote:

And you're positive that you've saved the workbook?

And you're positive that you're opening the workbook that you saved?

One test if you're positive...
Open the workbook
make the changes
save the workbook
close excel

Open excel in safe mode
windows start button|run
excel /safe
file|open your workbook that was just saved

Are the commandbuttons renamed?

If no, then maybe you have a macro that's changing the names of your
commandbuttons each time you open that workbook???

If yes, I don't have a guess.


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default Problem with command button name

Hmmm, is there a limit on the amount of character one can use for a
command button name? I have just noticed that all the buttons I am having
problems renaming would have names that are a little bit longer than the
buttons where renaming has worked.

3 buttons not allowing rename:
1st name is 35 chars long
2nd name is 33 chars long
3rd name is 36 chars long

Almost all the other names are under 30 chars long.

On Wed, 17 Oct 2007 21:54:41 +0000, Jason wrote:

Hi Dave,

I have actually just noticed that while in Design Mode in the Properties
window the name has been changed, but in the name box it still says
CommandButton1. It's like it not properly changing the name at all!?

Also, how do you check the name of command buttons while in safe mode?
My Developer tab disappeared, and I am not able to re-add it in safe mode,
as well now, none of the names for the command buttons appear in the
name box.

On Wed, 17 Oct 2007 15:59:32 -0500, Dave Peterson wrote:

And you're positive that you've saved the workbook?

And you're positive that you're opening the workbook that you saved?

One test if you're positive...
Open the workbook
make the changes
save the workbook
close excel

Open excel in safe mode
windows start button|run
excel /safe
file|open your workbook that was just saved

Are the commandbuttons renamed?

If no, then maybe you have a macro that's changing the names of your
commandbuttons each time you open that workbook???

If yes, I don't have a guess.


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default Problem with command button name

Turns out my problem was that the descriptive names I had chosen for the
Command Buttons were too long. 32 characters seems to be the limit.

Thank you Dave for your suggestion.

On Wed, 17 Oct 2007 19:42:34 +0000, Jason wrote:

Hi,

I am having a strange problem.
I have a workbook with 20 or so sheet, and on each sheet is a command
button. I have changed the default name of most of the command buttons to
better reflect its purpose, but a couple of them have been giving me
trouble.
I can change the name, and it stays that way while I have the workbook
open. But once I save the workbook, close it and then reopen it, the name
that I entered has reverted back to the default "CommandButton1". Any idea
what is going on here?

Thanks




  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Problem with command button name

Jason

With button from Control Toolbox or Forms Toolbar I can get way more than 32
characters to appear after save/close and re-open.


Gord Dibben MS Excel MVP

On Wed, 17 Oct 2007 22:28:29 GMT, Jason wrote:

Turns out my problem was that the descriptive names I had chosen for the
Command Buttons were too long. 32 characters seems to be the limit.

Thank you Dave for your suggestion.

On Wed, 17 Oct 2007 19:42:34 +0000, Jason wrote:

Hi,

I am having a strange problem.
I have a workbook with 20 or so sheet, and on each sheet is a command
button. I have changed the default name of most of the command buttons to
better reflect its purpose, but a couple of them have been giving me
trouble.
I can change the name, and it stays that way while I have the workbook
open. But once I save the workbook, close it and then reopen it, the name
that I entered has reverted back to the default "CommandButton1". Any idea
what is going on here?

Thanks


  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default Problem with command button name

Gord

It seemed like a pretty low number to me, but once I reduced the names to
32 chars or less, all my problematic buttons started to work right. What
can I say? Wierd.
Any thoughts why this might be the case?

On Wed, 17 Oct 2007 15:58:53 -0700, Gord Dibben wrote:

Jason

With button from Control Toolbox or Forms Toolbar I can get way more than 32
characters to appear after save/close and re-open.


Gord Dibben MS Excel MVP

On Wed, 17 Oct 2007 22:28:29 GMT, Jason wrote:

Turns out my problem was that the descriptive names I had chosen for the
Command Buttons were too long. 32 characters seems to be the limit.

Thank you Dave for your suggestion.

On Wed, 17 Oct 2007 19:42:34 +0000, Jason wrote:

Hi,

I am having a strange problem.
I have a workbook with 20 or so sheet, and on each sheet is a command
button. I have changed the default name of most of the command buttons to
better reflect its purpose, but a couple of them have been giving me
trouble.
I can change the name, and it stays that way while I have the workbook
open. But once I save the workbook, close it and then reopen it, the name
that I entered has reverted back to the default "CommandButton1". Any idea
what is going on here?

Thanks


  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Problem with command button name

Sorry, not a clue.

Not something I work with very often so unfamiliar.


Gord

On Wed, 17 Oct 2007 23:18:42 GMT, Jason wrote:

Gord

It seemed like a pretty low number to me, but once I reduced the names to
32 chars or less, all my problematic buttons started to work right. What
can I say? Wierd.
Any thoughts why this might be the case?

On Wed, 17 Oct 2007 15:58:53 -0700, Gord Dibben wrote:

Jason

With button from Control Toolbox or Forms Toolbar I can get way more than 32
characters to appear after save/close and re-open.


Gord Dibben MS Excel MVP

On Wed, 17 Oct 2007 22:28:29 GMT, Jason wrote:

Turns out my problem was that the descriptive names I had chosen for the
Command Buttons were too long. 32 characters seems to be the limit.

Thank you Dave for your suggestion.

On Wed, 17 Oct 2007 19:42:34 +0000, Jason wrote:

Hi,

I am having a strange problem.
I have a workbook with 20 or so sheet, and on each sheet is a command
button. I have changed the default name of most of the command buttons to
better reflect its purpose, but a couple of them have been giving me
trouble.
I can change the name, and it stays that way while I have the workbook
open. But once I save the workbook, close it and then reopen it, the name
that I entered has reverted back to the default "CommandButton1". Any idea
what is going on here?

Thanks


  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Problem with command button name

I got 31 in this (only the commandbutton on the worksheet):

Option Explicit
Private Sub CommandButton1_Click()
With Me.OLEObjects(1)
Debug.Print .Name
.Name = String(32, "a")
Debug.Print .Name & "--" & Len(.Name)
End With
End Sub

CommandButton1
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa--31

Even though I tried to use 32 characters, it was truncated.

And if I changed it to:
..Name = String(33, "a")
I got a run time error.



Jason wrote:

Turns out my problem was that the descriptive names I had chosen for the
Command Buttons were too long. 32 characters seems to be the limit.

Thank you Dave for your suggestion.

On Wed, 17 Oct 2007 19:42:34 +0000, Jason wrote:

Hi,

I am having a strange problem.
I have a workbook with 20 or so sheet, and on each sheet is a command
button. I have changed the default name of most of the command buttons to
better reflect its purpose, but a couple of them have been giving me
trouble.
I can change the name, and it stays that way while I have the workbook
open. But once I save the workbook, close it and then reopen it, the name
that I entered has reverted back to the default "CommandButton1". Any idea
what is going on here?

Thanks


--

Dave Peterson
  #10   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Problem with command button name

My error I guess.

I was thinking of the Button Caption


Gord

On Wed, 17 Oct 2007 19:37:53 -0500, Dave Peterson
wrote:

I got 31 in this (only the commandbutton on the worksheet):

Option Explicit
Private Sub CommandButton1_Click()
With Me.OLEObjects(1)
Debug.Print .Name
.Name = String(32, "a")
Debug.Print .Name & "--" & Len(.Name)
End With
End Sub

CommandButton1
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa--31

Even though I tried to use 32 characters, it was truncated.

And if I changed it to:
.Name = String(33, "a")
I got a run time error.



Jason wrote:

Turns out my problem was that the descriptive names I had chosen for the
Command Buttons were too long. 32 characters seems to be the limit.

Thank you Dave for your suggestion.

On Wed, 17 Oct 2007 19:42:34 +0000, Jason wrote:

Hi,

I am having a strange problem.
I have a workbook with 20 or so sheet, and on each sheet is a command
button. I have changed the default name of most of the command buttons to
better reflect its purpose, but a couple of them have been giving me
trouble.
I can change the name, and it stays that way while I have the workbook
open. But once I save the workbook, close it and then reopen it, the name
that I entered has reverted back to the default "CommandButton1". Any idea
what is going on here?

Thanks




  #11   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 149
Default Problem with command button name

This is all a guess:

You may be able to give a command button a name longer that 32 characters,
but my guess is that the 1st 32 are all that matters. It may be that those
32 characters have to be unique among all command buttons names (maybe among
all control/shape/object names) and any additional characters are
essentially ignored.

If the first 32 characters of a name are not unique the name will not be
accepted and will not 'stick'.



"Jason" wrote in message
om...
Gord

It seemed like a pretty low number to me, but once I reduced the names to
32 chars or less, all my problematic buttons started to work right. What
can I say? Wierd.
Any thoughts why this might be the case?

On Wed, 17 Oct 2007 15:58:53 -0700, Gord Dibben wrote:

Jason

With button from Control Toolbox or Forms Toolbar I can get way more than
32
characters to appear after save/close and re-open.


Gord Dibben MS Excel MVP

On Wed, 17 Oct 2007 22:28:29 GMT, Jason
wrote:

Turns out my problem was that the descriptive names I had chosen for the
Command Buttons were too long. 32 characters seems to be the limit.

Thank you Dave for your suggestion.

On Wed, 17 Oct 2007 19:42:34 +0000, Jason wrote:

Hi,

I am having a strange problem.
I have a workbook with 20 or so sheet, and on each sheet is a command
button. I have changed the default name of most of the command buttons
to
better reflect its purpose, but a couple of them have been giving me
trouble.
I can change the name, and it stays that way while I have the workbook
open. But once I save the workbook, close it and then reopen it, the
name
that I entered has reverted back to the default "CommandButton1". Any
idea
what is going on here?

Thanks




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 Help Kenny Excel Discussion (Misc queries) 2 October 15th 07 03:29 AM
Command Button tom Excel Worksheet Functions 0 November 3rd 06 11:37 AM
strange command button problem David Excel Discussion (Misc queries) 0 March 20th 06 03:06 PM
Command Button Steved Excel Worksheet Functions 2 February 19th 06 11:01 PM
command button Mike New Users to Excel 1 August 30th 05 01:39 AM


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