Results 1 to 8 of 8
  1. #1
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Dallas plus 20 miles or so, Texas, USA
    Posts
    876
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Ambiguous Name (2000)

    Hi all, I have somewhat followed the instructions in a previous post on ambiguous names, however, I am still stuck.

    I keep getting an error "Ambiguous Name Detected: ~" whenever I try to compile the project. If I go to any form in the project and try to step into the code, it returns the ambiguous name detected message with the form name added to the end. This is with every form in the project.

    Any ideas?

    Thanks,

  2. #2
    3 Star Lounger
    Join Date
    Jul 2001
    Location
    Long Beach, California, USA
    Posts
    233
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Ambiguous Name (2000)

    I don't wish to pose any copywrite issues, so in the VBE - Help - Answer Wizard tab type in Ambiguous Name Detected and you will get a response of "Avoiding Naming Conflicts"

    Hope this helps.

  3. #3
    Bronze Lounger
    Join Date
    Jun 2001
    Location
    New York, New York, Lebanon
    Posts
    1,449
    Thanks
    1
    Thanked 1 Time in 1 Post

    Re: Ambiguous Name (2000)

    Michael <img src=/S/hello.gif border=0 alt=hello width=25 height=29>

    I guess you have some thing in one of these categories:

    1) Two subroutines with the same name. Check all your names and change them a bit.
    2) You may have a name that is being confused with a Worksheet function. Look at your names of variables and objects and what have you.
    3) You maybe using a name that looks like a Reserved VBA Word. You can not name variables like ThisWorkbook or ActiveSheet.

    The BEST way to get rid of this is to follow naming conventions established by the expert community.
    For example instead of saying:
    Dim AlphabeticalCharacter as String
    I would say
    Dim <font color=red> s</font color=red>AlphabeticalCharacter as String , the <font color=red> s </font color=red> denotes String. It makes it easy on the programmer to understand and debug the code as well.

    Check "Guidelines for naming cells, formulas, and constants in Microsoft Excel" and "Visual Basic Naming Rules" in the OLH, plus consult the following MSKB articles: http:// support.microsoft.com/default.aspx?scid=kb;EN-US;Q211838 and http:// support.microsoft.com/default.aspx?scid=kb;EN-US;Q220613
    <img src=/S/compute.gif border=0 alt=compute width=40 height=20> in the <img src=/S/bagged.gif border=0 alt=bagged width=22 height=22>

  4. #4
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Dallas plus 20 miles or so, Texas, USA
    Posts
    876
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Ambiguous Name (2000)

    OK, I have narrowed this down to the most recent form I added...a 5 page multipage with about 300 textboxes (don't ask, I won't tell!). I removed this form and all is well. Guess I will have to import the form again and figure out where it is at.

    Also, for anyone out there who might have a similar problem. I first attempted to comment out the code with some of the forms I thought might be in question. One at a time, I commented code and compiled with the same error message. I finally found the guilty form because the compiler would not let me comment the code behind the guilty form. Every time I tried to comment the code in the guilty form, I got the ambiguous name message.

    Sooooo...if anyone is trying to track down a similar problem, you might try to comment it first. If you can, then that code in that module, or behind that form, or behind that sheet is not in question.

    Thanks,

  5. #5
    Bronze Lounger
    Join Date
    Jun 2001
    Location
    New York, New York, Lebanon
    Posts
    1,449
    Thanks
    1
    Thanked 1 Time in 1 Post

    Re: Ambiguous Name (2000)

    Mike

    IMHO developers should get into the habit of naming the objects they use just like variables and other objects.

    This has the added benefit that if International considerations are in order the code will be looking for a TextBox named tbFirstName not TextBox1 in English and what have you in other versions.

    Wassim
    <img src=/S/compute.gif border=0 alt=compute width=40 height=20> in the <img src=/S/bagged.gif border=0 alt=bagged width=22 height=22>

  6. #6
    Bronze Lounger
    Join Date
    Jun 2001
    Location
    New York, New York, Lebanon
    Posts
    1,449
    Thanks
    1
    Thanked 1 Time in 1 Post

    Re: Ambiguous Name (2000)

    Mark

    Thanks Thanks Thanks... <img src=/S/joy.gif border=0 alt=joy width=23 height=23>

    I saw that before and it made me laugh. Now I have the source and am looking for more if you have any send them my way.

    Wassim <img src=/S/laugh.gif border=0 alt=laugh width=15 height=15>
    <img src=/S/compute.gif border=0 alt=compute width=40 height=20> in the <img src=/S/bagged.gif border=0 alt=bagged width=22 height=22>

  7. #7
    New Lounger
    Join Date
    Nov 2001
    Location
    Amsterdam
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Ambiguous Name (2000)

    Good point, also bear this in mind <img src=/S/wink.gif border=0 alt=wink width=15 height=15>
    <A target="_blank" HREF=http://www.web-hits.org/txt/codingunmaintainable.html>http://www.web-hits.org/txt/codingunmaintainable.html</A>

  8. #8
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Dallas plus 20 miles or so, Texas, USA
    Posts
    876
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Ambiguous Name (2000)

    True...the textbox in question was a transparent box with no border that was the result of a copy and paste which I forgot about. I just happened to select the entire page and saw it sitting there all by itself in the corner!

    Thanks,

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •