Today's problem is not for the faint of heart, but I hope someone can come up with some ideas.
At my office, xlstartProd.xla has a few UDFs that are used as worksheet functions by all the folks in our domain.
For instance =LastNumber("Customer order 1234") returns 1234.
The user login script copies xlstartProd to %appdata%..\xlstart folder, so updates come automatically.
My personal functions are stored in xlStartBob.xla which only resides on my CPU.
For instance =FirstNumber("1234 is the customer") returns 1234 from the beginning of the string.
It turns out that Excel "simplifies" things by hiding the workbook names.
worksheet formulas show But their effective links act like this
--------------------------
---- --------------------------
----------
-------
=firstnumber(a1) ='xlstartBob.xla'!FirstNum
ber(a1)
=lastnumber(a1) ='xlstartProd.xla'!LastNum
ber(a1)
The actual link be viewed with ExcelMenu>Edit>Links
This leads to a problem which I just recently noticed. I want to "promote" FirstNumber to production status so others can use it. I moved FirstNumber from xlstartBob to xlstartProd.
Unfortunately, all my old workbooks now return #NAME? because 'xlstartBob.xla'!FirstNumb
er(a1) no longer exists.
I believe the original cause of the # NAME? problem came from I mistake I made three years ago. Even though the file extensions are .xla, I never completely turned the files into addins. Specifically, they do not show under tools>addins and they are not stored in %appdata%\microsoft\addins
. I'm not sure if that would solve the problem, but even if it would, I think it is too late to fix this mistake because there are many production excel files that contain ='xlstartProd.xla'!LastNum
ber(a1)
So, does anybody have any idea how to get out of this mess?
I have one idea that might work:
#1 rename xlstartBob to xlStartBobOld and change all of its functions to Private
#2 create a new xlstartBob that has this code like this
' ===== for functions that have been promoted to production =================
Function FirstNumber(x)
FirstNumber = Application.Run("'xlstartP
rod.xla'!F
irstNumber
", x)
End Function
' ===== for ALL functions that have been not promoted to production =================
Function FirstNumber(x)
FirstNumber = Application.Run("'xlstartB
ob1.xla'!F
irstNumber
OrZero", x)
End Function
#3 change the user login script. Where it currently copies xlstartProd to %appdata% , it would also copy xlstartBob to %appdata%
But, I hope someone can suggest something better.