Hi Govert and thanks for your response!
I was able to locate sender through your method and also write values into the sheet! Thanks for your help!
But I still have a problem with accessing classes from other parts of Addin project.
May I ask you for litle bit wider explanation of how you can interact with rest of Addin project?
Since UDF execution run on the main thread as well as rest of the Addin project classes i dont understand why I cant access classes from same namespace/Addin. For instance if I create static/singleton class with random Id assigned in constructor those there
is gonna be two different instances of those classes one used for UDF and second in Addin namespace/project.
So for instance if I want to interact from functions with static class which handles user management, database access, Ribbon menu etc... how could I do that? I've tried to access those classes from [ExcelFunction(IsMacroType=true)], but same result. Code look
public class UserDefinedFunctions
[ExcelFunction(IsVolatile = false, Description="Lancelot get data function")]
public static void LancelotGetData(string key, string from, string toEx, string obc)
//Lazy user authentication
string values = Controller.Instance.GetEnifData(key, from, toEx, obc);
private static void SetLancelotData(string values)
var caller = XlCall.Excel(XlCall.xlfCaller) as ExcelReference;
for(int i = caller.RowFirst; i <= caller.RowFirst + values.Length; i++)
//Insert value to cell