JenniferMurphy
Well-known Member
- Joined
- Jul 23, 2011
- Messages
- 2,687
- Office Version
- 365
- Platform
- Windows
I have a personal add-in module that I have used for years. It is called zzz add-ins.xlam and is stored, along with a couple of other add-in modules, here:
It contains dozens of UDFs that I have written over the years and that are used in hundreds of workbooks.
I have a workbook, Magazine log.xlam, that I use to keep track of magazines that I give to the grandkids on their birthdays. It has a code module (Module1) that contains a couple of UDFs that are specific to that workbook. It also has calls to a couple of UDFs in the add-in module. I have used that workbook for years.
Today, I was doing some work in the magazine workbook to add a couple of magazines. That sheet has calls to two UDFs in my add-in module, NextBirthday and MyFmtAge. I happened to notice that all of the calls to NextBirthday in my add-in module have been changed to include the add-in module name. For example, instead of
it is now
Interestingly, none of the calls to MyFmtAge, which is in the same add-in module, have the module name added.
If I remove the module name from the calls to NextBirthday, they get a #REF ! error and the UDF is never called.
I don't know how long it has been like that. I just noticed it today, but I am sure that it was not that way when I created the workbook originally.
When I checked the two UDFs, I noticed that MyFmtAge was declared Public and NextBirthday was not.
I changed NextBirthday to add "Public".
It still fails.
Can someone give me a clue as to what the problem is and how to fix it?
Code:
C:\Documents and Settings\Administrator\Application Data\Microsoft\AddIns
I have a workbook, Magazine log.xlam, that I use to keep track of magazines that I give to the grandkids on their birthdays. It has a code module (Module1) that contains a couple of UDFs that are specific to that workbook. It also has calls to a couple of UDFs in the add-in module. I have used that workbook for years.
Today, I was doing some work in the magazine workbook to add a couple of magazines. That sheet has calls to two UDFs in my add-in module, NextBirthday and MyFmtAge. I happened to notice that all of the calls to NextBirthday in my add-in module have been changed to include the add-in module name. For example, instead of
Code:
=nextbirthday(C7)
Code:
='zzz Add-Ins.xlam'!nextbirthday(C7)
If I remove the module name from the calls to NextBirthday, they get a #REF ! error and the UDF is never called.
I don't know how long it has been like that. I just noticed it today, but I am sure that it was not that way when I created the workbook originally.
When I checked the two UDFs, I noticed that MyFmtAge was declared Public and NextBirthday was not.
Code:
Function NextBirthday(DoB As Date, Optional vToday As Date) As Date
Public Function MyFmtAge(P_AgeFrom As Variant _
, Optional P_Units As String = "*" _
, Optional P_LabelSw As String = "Long" _
, Optional P_DP As Integer = 1 _
, Optional P_AgeTo As Variant _
, Optional P_NegText As Variant _
) As Variant
Code:
Public Function NextBirthday(DoB As Date, Optional vToday As Date) As Date
Can someone give me a clue as to what the problem is and how to fix it?