Skip to content

Implemented initial minimal support for native Excel add-ins #745

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 94 commits into from
Jun 23, 2025

Conversation

Sergey-Vlasov
Copy link
Contributor

Running MasterBuild\MasterBuild.cmd produces Package\nupkg\ExcelDna.AddIn.NativeAOT.0.1.0.nupkg.

Publishing the following C# project produces native 64-bit MyAddin.xll Excel add-in.

MyAddin.csproj:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>net8.0-windows</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>

    <RuntimeIdentifier>win-x64</RuntimeIdentifier>
    <PublishAOT>true</PublishAOT>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="ExcelDna.AddIn.NativeAOT" Version="0.1.0" />
  </ItemGroup>

</Project>

Functions.cs:

using ExcelDna.Integration;

namespace MyAddin
{
    public class Functions
    {
        [ExcelFunction]
        public static string MyHello(string name)
        {
            return $"Hello {name}!";
        }

        [ExcelFunction]
        public static int MySum(int i1, int i2)
        {
            return i1 + i2;
        }
    }
}

Added Dispatcher.

Added minimal IRtdServer ServerStart, ServerTerminate handlers.
Implemented ConnectData and Heartbeat handlers.
Implemented variant array marshalling from managed.
Added OnConnectData newValues result marshalling.
@govert govert merged commit 0dfd609 into master Jun 23, 2025
@govert govert deleted the NativeAOTMain branch June 23, 2025 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants