I can't use functions from another workbook in VBA.
I've created a personal sheet: 'Personal_Functions.xlam' with personal functions located in: C:\Users\UserID\AppData\Roaming\Microsoft\Excel\XLSTART.
Always starts up automatically when opening Excel-file
I'm able to use these UDFs straightforward in any of my workbooks.
=fctTest(1, 5)
which returns 6
However, I'm unable to call them in code:
Compile error: Sub or Function not defined.
I tried adding the *.xlam to the reference but received an error.
Name conflicts with existing module, project or object library
I also tried making a complete new empty *.xlam, and got the same error.
Is it not possible, or do I have to call them in a different way?
Example Coding that does not work:
Personal_Functions.xlam > Module1
Public Function fctTest(in1 As Integer, in2 As Integer)
fctTest = in1 + in2
End Function
Book1.xlsm > ModuleTest
Private Sub subTest1()
Dim test As Integer
test = fctTest(1, 5)
End Sub