@@ -613,21 +613,51 @@ protected virtual IEnumerable<ExcelDoubleCellValue> ArgsToDoubleEnumerable(IEnum
613
613
/// <returns></returns>
614
614
protected virtual IEnumerable < ExcelDoubleCellValue > ArgsToDoubleEnumerable ( bool ignoreHiddenCells , bool ignoreErrors , IEnumerable < FunctionArgument > arguments , ParsingContext context )
615
615
{
616
- return _argumentCollectionUtil . ArgsToDoubleEnumerable ( ignoreHiddenCells , ignoreErrors , arguments , context , false ) ;
616
+ return _argumentCollectionUtil . ArgsToDoubleEnumerable ( ignoreHiddenCells , ignoreErrors , false , arguments , context , false ) ;
617
617
}
618
618
619
619
/// <summary>
620
620
/// Will return the arguments as an enumerable of doubles.
621
621
/// </summary>
622
622
/// <param name="ignoreHiddenCells">If a cell is hidden and this value is true the value of that cell will be ignored</param>
623
623
/// <param name="ignoreErrors">If a cell contains an error, that error will be ignored if this method is set to true</param>
624
+ /// <param name="ignoreNestedSubtotalAggregate">If cells which value comes from the calculation of a SUBTOTAL or an AGGREGATE function should be ignored, set this to true</param>
625
+ /// <param name="arguments"></param>
626
+ /// <param name="context"></param>
627
+ /// <returns></returns>
628
+ protected virtual IEnumerable < ExcelDoubleCellValue > ArgsToDoubleEnumerable ( bool ignoreHiddenCells , bool ignoreErrors , bool ignoreNestedSubtotalAggregate , IEnumerable < FunctionArgument > arguments , ParsingContext context )
629
+ {
630
+ return _argumentCollectionUtil . ArgsToDoubleEnumerable ( ignoreHiddenCells , ignoreErrors , ignoreNestedSubtotalAggregate , arguments , context , false ) ;
631
+ }
632
+
633
+
634
+ /// <summary>
635
+ /// Will return the arguments as an enumerable of doubles.
636
+ /// </summary>
637
+ /// <param name="ignoreHiddenCells">If a cell is hidden and this value is true the value of that cell will be ignored</param>
638
+ /// <param name="ignoreErrors">If a cell contains an error, that error will be ignored if this method is set to true</param>
639
+ /// <param name="ignoreNestedSubtotalAggregate">If cells which value comes from the calculation of a SUBTOTAL or an AGGREGATE function should be ignored, set this to true</param>
624
640
/// <param name="arguments"></param>
625
641
/// <param name="context"></param>
626
642
/// <param name="ignoreNonNumeric"></param>
627
643
/// <returns></returns>
628
- protected virtual IEnumerable < ExcelDoubleCellValue > ArgsToDoubleEnumerable ( bool ignoreHiddenCells , bool ignoreErrors , IEnumerable < FunctionArgument > arguments , ParsingContext context , bool ignoreNonNumeric )
644
+ protected virtual IEnumerable < ExcelDoubleCellValue > ArgsToDoubleEnumerable ( bool ignoreHiddenCells , bool ignoreErrors , bool ignoreNestedSubtotalAggregate , IEnumerable < FunctionArgument > arguments , ParsingContext context , bool ignoreNonNumeric )
629
645
{
630
- return _argumentCollectionUtil . ArgsToDoubleEnumerable ( ignoreHiddenCells , ignoreErrors , arguments , context , ignoreNonNumeric ) ;
646
+ return _argumentCollectionUtil . ArgsToDoubleEnumerable ( ignoreHiddenCells , ignoreErrors , ignoreNestedSubtotalAggregate , arguments , context , ignoreNonNumeric ) ;
647
+ }
648
+
649
+ /// <summary>
650
+ /// Will return the arguments as an enumerable of doubles.
651
+ /// </summary>
652
+ /// <param name="ignoreHiddenCells">If a cell is hidden and this value is true the value of that cell will be ignored</param>
653
+ /// <param name="ignoreNestedSubtotalAggregate">If cells which value comes from the calculation of a SUBTOTAL or an AGGREGATE function should be ignored, set this to true</param>
654
+ /// <param name="arguments"></param>
655
+ /// <param name="context"></param>
656
+ /// <param name="ignoreNonNumeric"></param>
657
+ /// <returns></returns>
658
+ protected virtual IEnumerable < ExcelDoubleCellValue > ArgsToDoubleEnumerable ( bool ignoreHiddenCells , bool ignoreNestedSubtotalAggregate , IEnumerable < FunctionArgument > arguments , ParsingContext context , bool ignoreNonNumeric )
659
+ {
660
+ return ArgsToDoubleEnumerable ( ignoreHiddenCells , true , ignoreNestedSubtotalAggregate , arguments , context , ignoreNonNumeric ) ;
631
661
}
632
662
633
663
/// <summary>
@@ -640,7 +670,7 @@ protected virtual IEnumerable<ExcelDoubleCellValue> ArgsToDoubleEnumerable(bool
640
670
/// <returns></returns>
641
671
protected virtual IEnumerable < ExcelDoubleCellValue > ArgsToDoubleEnumerable ( bool ignoreHiddenCells , IEnumerable < FunctionArgument > arguments , ParsingContext context , bool ignoreNonNumeric )
642
672
{
643
- return ArgsToDoubleEnumerable ( ignoreHiddenCells , true , arguments , context , ignoreNonNumeric ) ;
673
+ return ArgsToDoubleEnumerable ( ignoreHiddenCells , true , false , arguments , context , ignoreNonNumeric ) ;
644
674
}
645
675
646
676
@@ -691,9 +721,9 @@ protected virtual IEnumerable<double> ArgsToDoubleEnumerableZeroPadded(bool igno
691
721
/// <param name="arguments"></param>
692
722
/// <param name="context"></param>
693
723
/// <returns></returns>
694
- protected virtual IEnumerable < object > ArgsToObjectEnumerable ( bool ignoreHiddenCells , IEnumerable < FunctionArgument > arguments , ParsingContext context )
724
+ protected virtual IEnumerable < object > ArgsToObjectEnumerable ( bool ignoreHiddenCells , bool ignoreErrors , bool ignoreNestedSubtotalAggregate , IEnumerable < FunctionArgument > arguments , ParsingContext context )
695
725
{
696
- return _argumentCollectionUtil . ArgsToObjectEnumerable ( ignoreHiddenCells , arguments , context ) ;
726
+ return _argumentCollectionUtil . ArgsToObjectEnumerable ( ignoreHiddenCells , ignoreErrors , ignoreNestedSubtotalAggregate , arguments , context ) ;
697
727
}
698
728
699
729
/// <summary>
@@ -755,12 +785,13 @@ protected CompileResult CreateResult(eErrorType errorType)
755
785
/// an <see cref="ExcelErrorValueException"/> with that errorcode will be thrown
756
786
/// </summary>
757
787
/// <param name="arg"></param>
758
- /// <exception cref="ExcelErrorValueException"></exception >
759
- protected void CheckForAndHandleExcelError ( FunctionArgument arg )
788
+ /// <param name="err">If the cell contains an error the error will be assigned to this variable</param >
789
+ protected void CheckForAndHandleExcelError ( FunctionArgument arg , out ExcelErrorValue err )
760
790
{
791
+ err = default ;
761
792
if ( arg . ValueIsExcelError )
762
793
{
763
- throw ( new ExcelErrorValueException ( arg . ValueAsExcelErrorValue ) ) ;
794
+ err = arg . ValueAsExcelErrorValue ;
764
795
}
765
796
}
766
797
@@ -769,11 +800,13 @@ protected void CheckForAndHandleExcelError(FunctionArgument arg)
769
800
/// an <see cref="ExcelErrorValueException"/> with that errorcode will be thrown
770
801
/// </summary>
771
802
/// <param name="cell"></param>
772
- protected void CheckForAndHandleExcelError ( ICellInfo cell )
803
+ /// <param name="err">If the cell contains an error the error will be assigned to this variable</param>
804
+ protected void CheckForAndHandleExcelError ( ICellInfo cell , out ExcelErrorValue err )
773
805
{
806
+ err = default ;
774
807
if ( cell . IsExcelError )
775
808
{
776
- throw ( new ExcelErrorValueException ( ExcelErrorValue . Parse ( cell . Value . ToString ( ) ) ) ) ;
809
+ err = ExcelErrorValue . Parse ( cell . Value . ToString ( ) ) ;
777
810
}
778
811
}
779
812
0 commit comments