File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -483,6 +483,42 @@ public static double NativeCalcSum([ExcelHandle] Calc c)
483
483
| A1 | =NativeCreateCalc(1.2, 3.4) | NativeCreateCalc:1
484
484
| A2 | =NativeCalcSum(A1) | 4.6
485
485
486
+ ``` csharp
487
+ [ExcelHandle ]
488
+ public class CalcExcelHandle
489
+ {
490
+ private double d1 , d2 ;
491
+
492
+ public CalcExcelHandle (double d1 , double d2 )
493
+ {
494
+ this .d1 = d1 ;
495
+ this .d2 = d2 ;
496
+ }
497
+
498
+ public double Mul ()
499
+ {
500
+ return d1 * d2 ;
501
+ }
502
+ }
503
+
504
+ [ExcelFunction ]
505
+ public static CalcExcelHandle NativeCreateCalcExcelHandle (double d1 , double d2 )
506
+ {
507
+ return new CalcExcelHandle (d1 , d2 );
508
+ }
509
+
510
+ [ExcelFunction ]
511
+ public static double NativeCalcExcelHandleMul (CalcExcelHandle c )
512
+ {
513
+ return c .Mul ();
514
+ }
515
+ ```
516
+
517
+ | Cell | Formula | Result
518
+ | ----- | ---------------------------------------| ------
519
+ | A1 | =NativeCreateCalcExcelHandle(1.4, 0.5) | NativeCreateCalcExcelHandle:1
520
+ | A2 | =NativeCalcExcelHandleMul(A1) | 0.7
521
+
486
522
# Not supported functionality in native add-ins
487
523
488
524
Loading images for ribbon controls.
You can’t perform that action at this time.
0 commit comments