Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   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


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 02:04 AM.

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

About Us

"It's about Microsoft Excel"