ExcelDna xll 加载项未显示,但功能可见,为什么?

ExcelDna xll add-in not shown but functions are visible, why?

我按照 ExcelDna 网页上的步骤创建了一个 ExcelDna 插件:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ExcelDna.Integration;
namespace ExcelCalculator
{
    public static class ExcelDnaTest
    {
        [ExcelFunction(Description = "My first .NET function")]
        public static string HelloDna(string name)
        {
            return "HelloDna " + name;
        }
    }
}

编译项目生成以下文件:

ExcelCalculator.dll
ExcelCalculator.pdb
ExcelCalculator-Addin.dna
ExcelCalculator-Addin.xll
ExcelCalculator-Addin-packed.xll
ExcelCalculator-Addin64.dna
ExcelCalculator-Addin64.xll
ExcelCalculator-Addin64-packed.xll

然后我将 ExcelCalculator-Addin.xll 拖到我的 Excel 2016 x86 会话中,我可以成功地 运行 函数并看到预期的结果。但是我在任何地方都看不到 ExcelCalculator 插件。它不在选项 -> 插件 -> Excel-插件

有没有人碰巧知道为什么?非常感谢。

它不会出现在“选项”->“加载项”列表中,除非您明确地将其安装在 Excel 中。仅使用“文件”->“打开”打开加载项不会安装它,下次启动时它不会自动加载 Excel。

如果您通过浏览和检查加载项将其添加到“加载项”对话框,则每次都会加载。