ActiveX CommandButton gets renamed when Sheet is cloned running Excel97

J

JimP

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
 
B

Bob Phillips

Jim,

You could try

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

--

HTH

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top