Ambiguous Name Detected

N

Nigel

I have a userform with a number of controls. When editing the controls I
named two items the same. Now I am unable to open and edit the userform as
I get the message 'Ambiguous Name detected' How do I fix this ?

Cheers
 
J

jaf

Hi Nigel,
I never had the problem so I'm not sure if this will work.

Open your project and right click the form in project explorer.
Choose export form.
Excel will save it with a .bas ext.
Open the .bas file with notepad, revise the control name & save the file.

Right click the form & this time choose delete.
Answer no to: do you want to save.

Right anywhere in the project explorer and choose import file or do a
file>import from the menus.
Import the file and save the workbook.


--

John

johnf202 at hotmail dot com


Nigel said:
I have a userform with a number of controls. When editing the controls I
named two items the same. Now I am unable to open and edit the userform as
I get the message 'Ambiguous Name detected' How do I fix this ?

Cheers




----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption
=---
 
N

Nigel

John,

Thanks for the tip. Exporting the form actually creates two files, .frm and
..frx
The .frm file has the form code which is editable in notepad. The .frx,
which I suspect has the control information is not editable and is encoded
in some way.

So its back to the drawing board!

I really don't understand why Excel lets you create duplicate names, close
the object and then complains when you try to open it again. Fortunately
the from was not too complex but I would rather not have to do it all again.

Cheers
Nigel
 
K

Ken Wright

What happens if you disable macros and try?

--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL2K & XLXP

----------------------------------------------------------------------------
Attitude - A little thing that makes a BIG difference
----------------------------------------------------------------------------



Nigel said:
I have a userform with a number of controls. When editing the controls I
named two items the same. Now I am unable to open and edit the userform as
I get the message 'Ambiguous Name detected' How do I fix this ?

Cheers





http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption
=---
 
H

Haldun Alay

Hi,

Can you get into code view, maybe you have two or more subs with the same
name. Because when I tried to rename a control as same as with the existing
one's, i get an error message (Could not set the name property:unknown name)
and it was not possible to change it.

But in the code view of userform, if I copy one sub with the same name into
same place, while I try to compile, I get an error message (Ambiguous Name
Detected:-Sub Name")

--
Regards

Haldun Alay

To e-mail me, please remove AT and DOT from my e-mail address.



iletide þunu yazdý said:
I have a userform with a number of controls. When editing the controls I
named two items the same. Now I am unable to open and edit the userform as
I get the message 'Ambiguous Name detected' How do I fix this ?

Cheers




----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption
=---
 
J

jaf

That's correct. My mistake. Modules are exported as .bas.
You still should be able to edit & import the file. You have to delete the
original file or you will have two the same name.

--

John

johnf202 at hotmail dot com


Nigel said:
John,

Thanks for the tip. Exporting the form actually creates two files, .frm and
.frx
The .frm file has the form code which is editable in notepad. The .frx,
which I suspect has the control information is not editable and is encoded
in some way.

So its back to the drawing board!

I really don't understand why Excel lets you create duplicate names, close
the object and then complains when you try to open it again. Fortunately
the from was not too complex but I would rather not have to do it all again.

Cheers
Nigel


controls




----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption
=---
 
H

Haldun Alay

Hi,

One more suggestion, If you get an error message "Ambiguous Name detected:
~". You have one chance to fix it.

You need a HEX editor (I used windows Edit program from dos command line and
it worked).

1. Export that userform.

2. Backup for any mistakes.

3. Open the FRX extention with Edit (use command line option edit /77
userform1.frx)

4. Find the control names and just change on character on it, Be careful
don't shorten or lengthen the text.

5. Save it and import to excel.


Good Luck



--
Regards

Haldun Alay

To e-mail me, please remove AT and DOT from my e-mail address.
 
B

Bob Flanagan

How about an out of the box approach: Do a global change of the word Sub to
'Sub. This will convert it to a comment line in all modules and all form
modules. Your code will be full of errors (as there are no subs...), but
there won't e an ambiguous name. Edit the duplicat name, then change all
'Sub back to Sub.

Bob Flanagan
Macro Systems
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel

Nigel said:
I have a userform with a number of controls. When editing the controls I
named two items the same. Now I am unable to open and edit the userform as
I get the message 'Ambiguous Name detected' How do I fix this ?

Cheers




----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption
=---
 
N

Nigel

Haldun
Many thanks - I edited it using a HEX editor there were two controls of the
same name!!

Changed, saved and Reimported fixed it.

But why I can create duplicate entries in a from in the first place escapes
me?

Cheers
Nigel
 
N

Nigel

John
I was able to edit it and change the duplicate name using a HEX editor.
What a bizarre thing to have to do!!

Cheers
Nigel
 
H

Haldun Alay

Hi,

Nice to hear it worked. But actually I don't have any idea about how Excel
let you to give same name to two controls. I have Excel 2002 and it didn't
let me to change name of the control if there is a control that already
exist with the same name.

--
Regards

Haldun Alay

--
Regards

Haldun Alay

To e-mail me, please remove AT and DOT from my e-mail address.



iletide þunu yazdý said:
Haldun
Many thanks - I edited it using a HEX editor there were two controls of the
same name!!

Changed, saved and Reimported fixed it.

But why I can create duplicate entries in a from in the first place escapes
me?

Cheers
Nigel






----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption
=---
 
N

Nigel

Yes I don't know either, I have tried to re-create this error and I get the
warning message from the properties window. Also using Excel 2002.

The only difference is that I built the form earlier added some code etc.,
then later added new controls (with the same name) and it accepted it. I
have also tried this again and I still cannot recreate the problem!

The lesson is make sure you don't set up controls with the same name as you
(I) cannot rely on the system trapping the error under all circumtances.

Cheers
Nigel
 

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