Skip to content

Commit b9ad1bb

Browse files
committed
Added an example for functions using [ExcelHandleExternal] assembly attribute.
1 parent b94a0b3 commit b9ad1bb

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

docs/guides-basic/dotnet-native-aot-support.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,27 @@ public static double NativeCalcExcelHandleMul(CalcExcelHandle c)
519519
| A1 | =NativeCreateCalcExcelHandle(1.4, 0.5) | NativeCreateCalcExcelHandle:1
520520
| A2 | =NativeCalcExcelHandleMul(A1) | 0.7
521521

522+
```csharp
523+
[assembly: ExcelHandleExternal(typeof(System.Reflection.Assembly))]
524+
525+
[ExcelFunction]
526+
public static System.Reflection.Assembly NativeGetExecutingAssembly()
527+
{
528+
return System.Reflection.Assembly.GetExecutingAssembly();
529+
}
530+
531+
[ExcelFunction]
532+
public static string? NativeGetAssemblyName(System.Reflection.Assembly assembly)
533+
{
534+
return assembly.GetName().Name;
535+
}
536+
```
537+
538+
| Cell | Formula | Result
539+
| ----- | ------------------------------| ------
540+
| A1 | =NativeGetExecutingAssembly() | NativeGetExecutingAssembly:1
541+
| A2 | =NativeGetAssemblyName(A1) | ExcelDna.AddIn.RuntimeTestsAOT64
542+
522543
# Not supported functionality in native add-ins
523544

524545
Loading images for ribbon controls.

0 commit comments

Comments
 (0)