ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Command button naming issue (https://www.excelbanter.com/excel-programming/441170-command-button-naming-issue.html)

Ken Warthen[_2_]

Command button naming issue
 
In an Excel 2007 workbook I have a worksheet with several command buttons on
it. I use somewhat wordy names for my command buttons, e.g.,
cmdEBITLessThanZeroGreaterThanNegativeOneHundred. I'm now having a problem
where the command button name is not saving properly. In edit view I can
double click on the command button and it will open the editor to the routine
for that button. I save the workbook, close it, and open it again. Now if I
double click on the command button in edit view it opens another routine
called cmdEBIT_Click with no code listed in the routine. This really has me
baffled. Is there a limit to the length of a command button name?

Ken

Peter T

Command button naming issue
 
Although it seems possible to give an ActiveX control a long name in
properties, the limit for Objects names in general is 31, eg sheets, shapes
etc. You couldn't say give a long name to the control in the Names box left
of the input bar.

Maybe a bit more economy in your naming, eg

cmdEBITLessThanZeroGreaterThanNegativeOneHundred
vs
cmdEBIT_0toNeg100
maybe with some other key to denote the less/more than's if really necessary

Don't forget you can always include additional info in the comments

Regards,
Peter T



"Ken Warthen" wrote in message
...
In an Excel 2007 workbook I have a worksheet with several command buttons
on
it. I use somewhat wordy names for my command buttons, e.g.,
cmdEBITLessThanZeroGreaterThanNegativeOneHundred. I'm now having a
problem
where the command button name is not saving properly. In edit view I can
double click on the command button and it will open the editor to the
routine
for that button. I save the workbook, close it, and open it again. Now
if I
double click on the command button in edit view it opens another routine
called cmdEBIT_Click with no code listed in the routine. This really has
me
baffled. Is there a limit to the length of a command button name?

Ken





All times are GMT +1. The time now is 09:45 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com