From 205eebb7da67a88f809443e9d4d53df5410de45e Mon Sep 17 00:00:00 2001 From: Kevin Darby Date: Thu, 4 Jul 2019 23:43:22 -0400 Subject: [PATCH] excel formulae --- src/client/spark_excel/utils/Generate.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/client/spark_excel/utils/Generate.cs b/src/client/spark_excel/utils/Generate.cs index 28e9ad95a..fa3adcab1 100644 --- a/src/client/spark_excel/utils/Generate.cs +++ b/src/client/spark_excel/utils/Generate.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Reflection; using System.Text.RegularExpressions; using ExcelDna.Integration; +using ExcelDna; using bts.api; using Newtonsoft.Json; using Newtonsoft.Json.Linq; @@ -16,8 +17,12 @@ namespace bts.excel static ConcurrentDictionary _cache = new ConcurrentDictionary(); [ExcelFunction(IsMacroType = true)] - static public void bts_generate_code_from_sink(string name, [ExcelArgument(AllowReference=true)] object sink) + static public string bts_generate_code_from_sink(string name, [ExcelArgument(AllowReference=true)] object sink) { + ExcelReference rref = (ExcelReference)sink; + var form = XlCall.Excel(XlCall.xlfGetCell, 41, rref); + //var formabs = XlCall.Excel(XlCall.xlfFormulaConvert, form, ExcelDna. + return form.ToString(); } }