npoi SetCellFormula custom formula in VBA

2019-08-31 04:43发布

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));

0条回答
登录 后发表回答