Breakpoints ignored in User-defined function

I’m having trouble debugging a udf. I inserted a breakpoint so that I can watch variables and step through the function. The breakpoint functions as expected if I hit “run Basic” from the LibreOffice Basic window but since it was not called by the spreadsheet, all parameters are empty. If I call the function from a spreadsheet, It returns values (not the ones I expected) but ignores the breakpoint. How can I debug a user-defined function?

I’m not sure if I understood the question correctly, but it seems to me that the natural way would be to write another Basic procedure that would call the desired function with whatever arguments you want to test and Print the output. Then run that procedure from the Basic window.

If you need to use Calc functions in the arguments, it’s easiest to first find out the calculated values of the arguments in Calc, and then use those values in the function call in Basic.