Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error: Ambiguous name detected.Then: Document not saved!! 1

Status
Not open for further replies.

spartain

Technical User
Jun 19, 2003
23
US
Hello all,
I've got a pretty frustrating problem. I have an Excel workbook with quite a bit of VBA code behind it (it's basically an automated order-entry database, which I have to do in Excel rather than Access). Anyway, it was working great until about a week ago when I added in some functionality that involved a new form, some images, and a couple of control buttons. I wasn't able to get all the way through writing the code when I had to save and quit. The next day, when I opened the program, I got the error: "Ambiguous Name Detected", which calls the debugger. The problem is I'm not sure where the ambiguous name is (I can't find it, and the debugger doesn't take me there). So I tried deleting all of the new stuff--but every time I try to save the program, it won't let me: "Document not saved." pops up. So now I have some bad code that won't let me run the program, but I can't get rid of it because I can't save any changes. Anyone have any ideas, either on how to track down the ambiguous code or (better yet) how to get around a "Document not saved." message? I really don't want to rebuild the whole thing...
Thanks!
 
Try to export, and then re-import, all of the VBA code and userform modules. That sometimes clears up mysterious problems for me.


Rob
[flowerface]
 
Usually the 'Ambiguous name detected' error is caused by having more than one subroutine with the same name (AFAIK) so make sure all your subs have different names

HTH

Chris ;-)
 
Thanks to both of you for replying. Rob, I hadn't tried the import/export idea, so I did. I exported all of my forms and modules and added them back in one at a time, compiling the project after each one. This allowed me to isolate the module that was causing the problem (it wasn't the one I thought)and by leaving it out, I was able to save the program. Right now I'm still investigating the code in that module to figure it out, but I think that won't be too hard.
Thanks for your help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top