Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 206
Default problem removing controls

i have programmatically deleted 'CommandButton2' from my sheet using

ActiveSheet.Shapes("CommandButton2").delete

now when i open my workbook i get the following:

Can't exit design mode because Control 'CommandButton2' can not be created

i can't find any references to command button 2 in my code (on this sheet) -
what do i do? I do have other commandbutton2's on other sheets.

if i try to rename one of my controls to CommandButton2 i get a

Ambiguous name detected: CommandButton2
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 252
Default problem removing controls

Without seeing the code, it sounds like in your opening event you are trying
to create a command button for something and trying to name it
CommandButton2. Since you already have a CommandButton2 (even if it is on
another sheet) Excel wants to name the new button the next workbook-wide
number in sequence, say CommandButton14

This is just a guess from my past experience watching how excel names the
new buttons in a workbook.

"Gixxer_J_97" wrote:

i have programmatically deleted 'CommandButton2' from my sheet using

ActiveSheet.Shapes("CommandButton2").delete

now when i open my workbook i get the following:

Can't exit design mode because Control 'CommandButton2' can not be created

i can't find any references to command button 2 in my code (on this sheet) -
what do i do? I do have other commandbutton2's on other sheets.

if i try to rename one of my controls to CommandButton2 i get a

Ambiguous name detected: CommandButton2

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 206
Default problem removing controls

i still wasn't able to figure out what the problem was. i didn't have an
open event and i'm not creating any controls - this problem started when i
saved a copy of the workbook, deleted all the vba out of the new workbook,
and then deleted the controls. as i was debugging i selected the wrong
workbook (thus changing active workbook) and it deleted the controls out of
my 'master' book.

i ended up going to a previous backup and copied over the code changes and
all seems to be ok.

J
"gocush" wrote:

Without seeing the code, it sounds like in your opening event you are trying
to create a command button for something and trying to name it
CommandButton2. Since you already have a CommandButton2 (even if it is on
another sheet) Excel wants to name the new button the next workbook-wide
number in sequence, say CommandButton14

This is just a guess from my past experience watching how excel names the
new buttons in a workbook.

"Gixxer_J_97" wrote:

i have programmatically deleted 'CommandButton2' from my sheet using

ActiveSheet.Shapes("CommandButton2").delete

now when i open my workbook i get the following:

Can't exit design mode because Control 'CommandButton2' can not be created

i can't find any references to command button 2 in my code (on this sheet) -
what do i do? I do have other commandbutton2's on other sheets.

if i try to rename one of my controls to CommandButton2 i get a

Ambiguous name detected: CommandButton2

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
Problem with TAB key and Textbox controls Paul M[_4_] Excel Programming 2 June 6th 14 05:54 PM
Problem with looping through userform controls Jeremy Gollehon[_2_] Excel Programming 5 February 17th 05 05:41 PM
problem in removing add-in Bhagwandas Excel Programming 3 November 25th 04 02:22 PM
Removing Controls at RunTime? Neily[_3_] Excel Programming 1 November 25th 04 02:17 PM
A wacky problem - controls move on the screen after printing Ellis Horowitz Excel Programming 2 June 30th 04 10:55 PM


All times are GMT +1. The time now is 12:54 PM.

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"