We want to be able to programmatically create an Excel workbook that invokes custom code inside a cell. The cells would look something like this:
=MyCode(A1:A10)
My first thought was to use VBA, but since the algorithm is patented, the credentials that want it to be protected. I can put a password on it, but it is well documented (here on StackOverflow) about how to get around such passwords.
My second thought was to create an Excel 2013 workbook project in Visual Studio, but I did not find anything useful in how to expose a function in C # so that it can be called as I described.
Next, I thought about VBA calling C #, and found instructions at https://msdn.microsoft.com/en-us/library/bb608613.aspx . I followed these instructions for writing, but when I try to run VBA code, I get an error with the GetManagedClass function: the object library function is not supported.
Are there any good recommendations on how to do something like this?
source share