Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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



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
Why doesn't formula work if sheet is renamed? Gatsby Excel Discussion (Misc queries) 9 February 15th 07 10:57 PM
Renamed invalid sheet name Angela Excel Discussion (Misc queries) 7 February 17th 06 03:18 PM
UserForm problem when Worksheet is cloned JimP Excel Programming 1 November 18th 04 02:52 AM
Do not want sheet renamed Michael Wise[_8_] Excel Programming 3 September 2nd 04 02:08 PM
Running a CommandButton in Excel I get this error Bert[_4_] Excel Programming 4 May 5th 04 07:06 PM


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