Re: VB6 name conflicts in module... error
- From: "Someone" <nobody@xxxxxxx>
- Date: Wed, 5 Oct 2005 01:51:25 -0400
This happens when you have the same module name in 2 different files. For
example, you have Module1 in your current project and you want to import
another Module1 you have made a long time ago. VB cannot load both of them,
even if you rename the file.
There are 2 solutions for this.
1 - Using manual edit:
- Copy the file you want to add to the same folder as your project, rename
as necessary.
- If the file is a Form or a UserControl, copy the FRX and CTX(?) files and
rename them as well(if they exist). These files hold binary information for
the form or user control.
- Open the file in Notepad.
- Look for the following line:
Attribute VB_Name = "Module1"
- Change it to something else that is not in use in the new project, like
"Module2".
- Save the file.
- Add it to your new project.
2 - Using VB IDE:
- Start a New Project that has the same project type(Standard EXE/ActiveX)
as the project the file was obtained from.
- VB will create Form1, Class1, UserControl1 by default depending on the
project type.
- Right click on Form1/Class1/UserControl1 and select Remove <object name>.
- Go to Project|Add File, and add the file that you want.
- Open the file and go to properties(F4).
- Change the name, for example, from Module1 to Module2.
- Use "Save <file name> As" to save the new file to the folder of your new
project.
- Close the VB IDE without saving anything.
- Open your new project and go to Project|Add File, and add the file.
Note that if you use the VB IDE method, it's important that you set the
project type to the same type used in the old project. This only applies to
Classes and UserControls. The reason for this is that these types of files
have instancing property that is usually set to Public. If you load the file
in a standard EXE project, then VB will switch that property to Private
after giving you a warning. Private classes and user controls cannot be used
outside the ActiveX DLL/EXE/OCX, but this is usually easy to fix.
"eatc7402" <eatc7402@xxxxxxxxxxx> wrote in message
news:wZGdnRUT6OHNxt7eRVn-qA@xxxxxxxxxxxxxx
> Well I'm stumped...
>
> I'm running VB6 on Windows XP (sp2). I am trying to load a .bas module to
> an
> existing project. The project already has one other module. When I try to
> load the new
> modue I get the following error...
> "Name conflicts with existing module, project, or object group"
>
> I've done the following:
> 1. removed the prexisting module... the new module then loads
> 2. Commented OUT all the code in new module, still get load error when
> preexisting module is
> also in project
> 3. Commented out all code in preexisting module .... still get load error
> to recap with ALL code commented out in BOTH bas modules I still
> get load error.
> 4 I removed the 'background loading' option in the advanced option dialog
> as mentioned in HELP FILES. No help... still get error.
> 5. Copied all code in offending module and put code in a NEW module
> and saved with a totally unique filename. No help.. still get loading
> error
>
> I'm stumped. What to try next??
> DavidF, eatc7402
>
.
- References:
- VB6 name conflicts in module... error
- From: eatc7402
- VB6 name conflicts in module... error
- Prev by Date: VB6 name conflicts in module... error
- Next by Date: Re: can see the Code in EXE
- Previous by thread: VB6 name conflicts in module... error
- Next by thread: Re: can see the Code in EXE
- Index(es):
Relevant Pages
|