Moving code from one add-in module to another

JenniferMurphy

Well-known Member
Joined
Jul 23, 2011
Messages
2,691
Office Version
  1. 365
Platform
  1. Windows
I want to move several UDFs from one module in one of my add-ins to another module in the same add-in. I created the new module and moved the code, but now all of the calls to those UDFs get a Name error. From what I have read, this is an addressing problem in that the calls have an invisible path to the original add-in module. But I couldn't find a way to change that path or even see it.

I tried deactivating the add-in and reactivating it both with and without closing and reopening the workbook, but I still get a Name error.

How can I change the path?

How can I see the path to confirm that it is correct?

Thanks
 
If one addin is not shown in the list of add-ins at all, can you browse to it?
 
Upvote 0

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Functions/subroutines should not have the same name as a module (or anything else). It just makes your life difficult.
OK, but does it cause a conflict?

In general, I agree with you, but in this case it makes sense to me. Unless, of course, it causes a conflict. But then VBA should generate an error or warning message, no?
 
Upvote 0
back-up the file just in case.
Open it with double-click directly to confirm that it opens and there is no corruption.
To add it to Excel and install it
Options/Addins/Manage: excel Addins: Go... / Browse .... After file gets in the list make sure its checkbox is checked.

another way to add an add-in is from the immediate window of VBE:
Code:
Application.AddIns.Add "................."
Application.AddIns(".......").Installed = True
 
Upvote 0
To be on the safe side you can add a prefix to all module names something like mod or mod_
But at the moment this is a bit beside the point.
 
Upvote 0
If one addin is not shown in the list of add-ins at all, can you browse to it?
Oopps. I forgot to mention that.

Yes, from File | Options | Add-Ins | Manage Excel Add-Ins | Go, there is a Browse... button. If I click on it, I am taken to the add-in folder mentioned above and all of my add-ins are listed. If I select it and click Ok, I get this message:
A file named 'C:\Documents and Settings\Administrator\Application Data\Microsoft\AddIns\My Add-ins.xlam' already exists at this location. Do you want to replace it?

This message was confusing. I was afraid to click Yes. It didn't make sense to me that it wold be replacing the file.

Should I do that?
 
Upvote 0
The add-ins add method has this option to copy the selected add-in to the default add-in location (but it is already there :) ).
just move the file somewhere else and browse it there.
And make a back up copy first.
 
Upvote 0
back-up the file just in case.
Open it with double-click directly to confirm that it opens and there is no corruption.
To add it to Excel and install it
Options/Addins/Manage: excel Addins: Go... / Browse .... After file gets in the list make sure its checkbox is checked.

OK. That seemed to have worked. Thanks.


Now I have a different, but related problem.

While I was fiddling around, I made a copy of the add-in and gave it a slightly different name (My Add-ins Test). Now, in Project Explorer, I have three add-ins:
  • MyExcelAddIns (My Add-ins.xlam)
  • MyExcelAddIns (Temp Add-ins.xlam)
  • MyExcelAddIns (My Add-ins Test.xlam)

The first and third appear to be identical, which makes sense since one is a file copy of the other.

How do I get rid of the Test copy?

Ironically, in Excel, only one appears. In the list of Active Application Add-ins, only Temp Add-ins.xlam is listed. If I click on Go, the only one in the Add-ins available list is the last one, "My personal Excel add-in modules". It's checkbox is checked.

Why is only the Temp add-in listed even though the other two are clearly active.
 
Upvote 0
Beats me really. Some kind of confusion in the system.
I would uncheck them all then shut down excel. Remove them from the adsins folder then start excel again. Confirm all are gone.
Then shut down excel again copy one addin, start excel, check if addin is added, and again ...
Or remove the duplicate file, change slightly the name of the original and the check if it loads. Much simpler and will probably work. If it doesn't remove the original and load the duplicate. Anyways get rid of one of the files before you continue to work.
 
Upvote 0
I would uncheck them all then shut down excel. Remove them from the adsins folder then start excel again. Confirm all are gone.
Then shut down excel again copy one addin, start excel, check if addin is added, and again ...
Or remove the duplicate file, change slightly the name of the original and the check if it loads. Much simpler and will probably work. If it doesn't remove the original and load the duplicate. Anyways get rid of one of the files before you continue to work.

That seems to have worked.

One final (probably) question. How do I change the text that is displayed in the Name column of the Excel (not VBA) add-ins dialog?

I changed the text in the Project Description: field of the VBA Properties dialog, but that didn't affect the add-ins dialog. I make sure to save the add-in and to close and reopen Excel.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,175
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top