ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   ActiveX CommandButton gets renamed when Sheet is cloned running Excel97 (https://www.excelbanter.com/excel-programming/319666-activex-commandbutton-gets-renamed-when-sheet-cloned-running-excel97.html)

JimP

ActiveX CommandButton gets renamed when Sheet is cloned running Excel97
 
To All,

I developed a small routine in Excel2000 that has ActiveX Command
Button's on the worksheet. The name of one button is NAVIGATIONButton
(in the Properties view). The code I wrote uses this name without a
problem when running the .xls in excel2000.

A seperate module (of code) 'clones' the sheet at the Users request and
ALL ActiveX buttons which reside on the new sheet work fine with the
code when run in excel 2000.

PROBLEM:
When I run the .xls in Excel97 ... when the User clones the Master
sheet ... The ActiveX buttons resort back to the names CommandButton1,
CommandButton2 ... etc.????

I tried inserting code similar to the following:

ActiveSheet.Shapes("CommandButton2").name = "NAVIGATIONButton"

but to no avail ... The name change is not taking place. When the code
stops, I can manually go into the properties view and change the name
of the command button and then the code works fine.
ANY HELP WOULD BE APPRECIATED!

Thanks in advance,

JimP


Bob Phillips[_6_]

ActiveX CommandButton gets renamed when Sheet is cloned running Excel97
 
Jim,

You could try

activesheet.oleobjects("CommandButton2").name ="NAVIGATIONButton"

--

HTH

RP
(remove nothere from the email address if mailing direct)


"JimP" wrote in message
ups.com...
To All,

I developed a small routine in Excel2000 that has ActiveX Command
Button's on the worksheet. The name of one button is NAVIGATIONButton
(in the Properties view). The code I wrote uses this name without a
problem when running the .xls in excel2000.

A seperate module (of code) 'clones' the sheet at the Users request and
ALL ActiveX buttons which reside on the new sheet work fine with the
code when run in excel 2000.

PROBLEM:
When I run the .xls in Excel97 ... when the User clones the Master
sheet ... The ActiveX buttons resort back to the names CommandButton1,
CommandButton2 ... etc.????

I tried inserting code similar to the following:

ActiveSheet.Shapes("CommandButton2").name = "NAVIGATIONButton"

but to no avail ... The name change is not taking place. When the code
stops, I can manually go into the properties view and change the name
of the command button and then the code works fine.
ANY HELP WOULD BE APPRECIATED!

Thanks in advance,

JimP





All times are GMT +1. The time now is 03:39 AM.

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