In calc the names of my functions are set to lower case and fail

I have a macro from OpenOffice that worked for years. I updated to LibreOffice and when I try to invoke the function it gives me a result “#NAME?”. The function is invoked via =sktot($A13,A108:K122). The function is defined as:

Function SKTOT(Name, Optional Block)
Dim row as integer

For row = LBound(Block, 1) to UBound(block, 1)
	If Block(row, 1) = Name Then
	SKTOT = Block(row, 5)
	Exit Function
	End If
Next
SKTOT = "n/a"

End Function

It scans for a match of Name in column 1 (i.e. a108-a122) and returns the data from column 5. I noticed that the function name SKTOT keeps getting changed to lower case but relabeling the function to lower case does not solve the problem. Several other functions seem to work.

If a function name is changed to lower case it indicates that during compilation of the formula expression the name could not be found, hence the #NAME? error. In the case of a BASIC macro that may be because it is in a library or module that can’t be reached when the document is opened.

Thank you. I found that my macros were defined in a folder not accessible. I changed their location and everything now works.

Glad to help. Then please mark the answer as correct by clicking the check mark icon. Thanks.