Calling Procedures In Another Workbook

  • Thread starter Thread starter Al
  • Start date Start date
A

Al

For some reason, I cannot set up a reference to allow me
to call a procedure in another workbook. I am currently
running Windows 98 and have Office 2000. I keep getting
the error message "Name conflicts with existing module,
project, or object library". I opened a workbook, saved
it as Book2.xls. I then opened another workbook and saved
it as Book3.xls. I added 1 module and procedure to Book2
that called a macro I put in Book3. This is as simple a
test that I could think of. However, when I tried to
establish a reference between the two modules, I get the
above error message. I have no idea why I am getting this
message. Can anyone help me???????
 
The reference is dependent on the project name. This default to VBAProject.
You can rename it in the properties of the project name (select the project
name in the project explorer. It will be something like
VBAProject(Book3.xls) )

select that and do F4 to see the properties window (unless it is already
visible).

You have one property (name). Change it from VBAProject to something
unique.

Once you do that, (and possibly save it), then you can create a reference to
it.

Without a reference you can do

application.run "Book3.xls!macro1"
 
Thanks Tom. I had no idea why I was getting the message,
and you really helped.
 

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

Back
Top