Excel-DNA / ExcelDna

Excel-DNA - Free and easy .NET for Excel. This repository contains the core Excel-DNA library.
https://excel-dna.net
zlib License
1.27k stars 271 forks source link

Support for Excel Udfs inside Nested Classes #179

Open augustoproiete opened 6 years ago

augustoproiete commented 6 years ago

Reported by Garrett Womack on the ExcelDna mailing-list.

From: Garrett Womack Date: Thu, Apr 19, 2018 at 9:24 PM Subject: [ExcelDna] Excel Udfs in Nested Classes To: Excel-DNA

Hi Govert,

I noticed that Udfs aren't available in excel if you have them embedded in a nested class. Just wanted to point this out.

=== Works ===

public static class Udfs
{
    // Put Udfs here
}

=== Doesn't Work ===

public static class Udfs
{
    public static class FinancialUdfs
    {
        // Put Udfs here
    }
}
augustoproiete commented 6 years ago

I'm not sure it's a scenario we'd like to support via the automatic registration. There's a cost in scanning the top-level classes in the assemblies already, not sure we'd want to pay for the cost of scanning inner classes as well.

Using the Custom Registration would be a better fit for this scenario: https://github.com/Excel-DNA/Registration