如何将excel VSTO add in转换为.xll直接通过excel添加

How to convert excel VSTO add in in to a .xll to add directly through the excel

我需要帮助来理解 VSTO 插件与 .xll excel 插件。 两个插件之间有什么区别? 是否有可能将 VSTO excel 插件转换为 .xll 文件以直接附加到 excel 工作表中?

XLL 插件

XLL 加载项是通过 Excel Software Development Kit 创建的较旧的本机代码加载项。这些加载项使用 c/c++ 编写并利用 COM 互操作。

VSTO 加载项

Visual Studio Office 工具 (VSTO) 加载项是通过 C# 等托管代码创建 Excel 加载项的现代方法。 Microsoft 提供托管 API 而不是原始 COM 来访问 Office 产品,包括 Excel.

OP:

Is there any possibility to convert VSTO excel addin into a .xll file to directly attach in an excel worksheet?

是也不是。您需要重新编写加载项,不仅要使用 c/c++ 而不是 .NET,还要使用 COM API 而不是 VSTO 管理的库。遗憾的是,没有简单的方法来做到这一点。