当我输入公式时,我想知道最后一个公式是什么。
例如,首先,我输入'= custom(1,2)',当我将公式更改为'= custom(2,3)'时,我想知道最后一个公式。
如果您知道解决方案,请帮助我
这样的事情怎么样?
public class Class1
{
public static string LastFormula = "";
[ExcelFunction(Description = "")]
public static object Foo(string val)
{
var app = (Microsoft.Office.Interop.Excel.Application)ExcelDna.Integration.ExcelDnaUtil.Application;
Microsoft.Office.Interop.Excel.Range cell = app.ActiveCell;
LastFormula = cell.Formula;//
return val;
}
}