1. Your method SetValue is not registered as a worksheet function since it does not return anything. To be registered as a function you need to change the return type to something like 'string'. Anyway, create a general Range 'Setter' function like you seem
to have there is a really bad idea - see the discussion for point 2. below.
2. In general Excel does not allow you to change other parts of the sheet from within a worksheet calculation. This is true whether you are using VBA, the C API or Excel-DNA. There are some workarounds for this, but I'd strongly recommend you not do
Why would Excel prevent this? Excel builds a dependency tree for the sheet to figure out which cells depend on which functions. By setting an arbitrary cell's values from within you function, you effectively break Excel's ability to keep track of which cells
to recalculate when specific cells changes.
What can you do? I suggest you set those cells with a function that depends on whatever the inputs are. Alternatively you can create a macro that is attached to a menu item or keyboard shortcut, for setting the required cells.