Moving code from one add-in module to another

JenniferMurphy

Well-known Member
Joined
Jul 23, 2011
Messages
2,532
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
 
You have to change the file's title property.

That worked thanks. For those, like me, who don't know how to do that, you have to open up the file Properties dialog. In Win XP, it works like this:


  • Make sure that Excel is closed.
  • Locate the file in Explorer.
  • Right click and select Properties or click on File | Properties.
  • Click the Summary tab.
  • Fill in the Title: field.
  • Click OK or Apply and then OK.
 
Upvote 0

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Or from within Excel: (depending on version) File tab (Backstage) - Info - File properties are on the right
 
Upvote 0
Or from within Excel: (depending on version) File tab (Backstage) - Info - File properties are on the right

I think you are talking about the title of the workbook. No? I was talking about the title of the Add-In file.

In any case, I don't see any "Backstage" option in Excel 2007. There is a Prepare option under File and it has a Properties selection. And there you can set title, but it is for the workbook.
 
Upvote 0
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?

Not a conflict per se, but you'd have to call it using =module_name.function_name() syntax rather than just =function_name() otherwise you'd get a #NAME ? error. VBA wouldn't warn you since there's nothing wrong with the code itself.
 
Upvote 0
Not a conflict per se, but you'd have to call it using =module_name.function_name() syntax rather than just =function_name() otherwise you'd get a #NAME ? error. VBA wouldn't warn you since there's nothing wrong with the code itself.

Thank you. Thank you. Thank you. (y)

I was getting a Name error with this code, but I have been having so much trouble and getting so many different errors, that it never occurred to me that moving the code to a module by the same name was causing the problem.

You have probably saved me hours and hours of :confused: & :oops: .

Thank you so much. (y)
 
Upvote 0

Forum statistics

Threads
1,215,044
Messages
6,122,827
Members
449,096
Latest member
Erald

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