I'm new to XLL development and have been trying to invoke a registered function as a macro in my XLL. I'm trying to get write access to cells adjacent to my calling cell.
The xlSet function looks like it will give me the ability to do that. But it does not look like this function can be called from my Xll function https://docs.microsoft.com/en-us/office/client-developer/excel/xlset
From the API, it seems this function needs to be called from a macro. I've tried using the xlUDF function to "trick" excel into thinking I'm running a function as a macro, but haven't had much luck. The xlUDF function gets invoked, but xlSet still fails.
How would I invoke a macro that can call this function ? It seems C#/ExcelDna has the equivalent of :
object xlApp = ExcelDnaUtil.Application;
xlApp.GetType().InvokeMember("Run", BindingFlags.InvokeMethod, null, xlApp, new object[]{macroName});
Many thanks in advance!