Getting "Name conflicts with existing module, project, or object library " when doing Add File to a project

I do not see how it would conflict ...

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Carl TawnSystems and Integration DeveloperCommented:
Are you adding a new file or an existing file ?
Well, this happens when two names conflict, obviously.
It is hard to tell you how to fix this without seeing your
project. But, one suggestion try a different name.

Forms have two names.

Saved file name, and form name. Chances are you have
two saved names that are different. Say one is saved as
Calculator.Frm and one is saved as Game.Frm. But both
have an internal name of Form1. You can not do this, you
then would have two Form1's and confuse the compiler.

Simple solution:

Open both forms individually, go to the Name property,
and change one to say: Form1, and one to Form2.
Then, you can reopen your project and add them both.
Good luck.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
If your reference (class) contains a same name as your form or class or module, then you will get this error
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

AlexF777Author Commented:
it is a .bas file.

What I have noticed is if my .bas file is a part of some other project - VB complains,
otherwise - it does not ...
This is what I was telling you. It is not a matter of which project it is apart of.
It is the fact that you have Module1 added in a project. You save this as say
Winsock.Bas. Then you have another project, say you save a Bas as Skin.Bas.
But then you think oh! That would be great if this program could connect to
the internet. Then, you add Winsock.Bas. The program (VB) now errors, it
can not add Winsock.Bas. Winsock.Bas has a name Module1. The problem
is you already have Module1(Skin.Bas) Two module1's just can not happen.

Like I said, what you need to do is open the one you wish to add. Change
it's name in the property window to something along the lines of what
the module does, rather than Module1. It is good practice to always change
your Module names. This way you can easily add Modules to any project
at any time. Because what are the chances that you have two Winsock.Bas
modules? The chances are unlikely because, why would you write two
things that do the same function? So change your names of the Module
itself, and not the .Bas file. This should allow you to add your modules
with ease. Good luck.
>>What I have noticed is if my .bas file is a part of some other project

I don't think that is the problem, you may want to change this line

Attribute VB_Name = "Module1"


Attribute VB_Name = "somethingelse"

Open your .bas from notepad, this is the first line appears on the .bas
EDDYKT that is exactly what I have said twice now.
Attribute VB_Name = "NAME" Is the name listed
under Name in properties window. Once again, you
need to change this , because two of your items have
the same name, with different FILE names. And when
you have two internal names the same like that it
will give you errors, because it can not handle it.
Also make sure that the *name* of the module does not conflict with any libraries you have added in Project->References.  e.g. If you add a reference to win32.tlb, you cannot have a module with a name of "win32."
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.