问题
I have an application that fills with data an excel template .Template is .xlsm .In template I created vba function called SumByColor when i try to set a cell formula to this function i get this error :
{"Name 'SumByColor' is completely unknown in the current workbook"}
I set formula like this :
sheet.GetRow(rowIndex).GetCell(startPos + 2).SetCellFormula(string.Format("SumByColor($AQ$7,F{0}:AI{0})",rowIndex+1));
来源:https://stackoverflow.com/questions/25077009/npoi-setcellformula-custom-formula-in-vba