首页 > 解决方案 > Visual Studio Excel 加载项开发 - 无法激活 Windows 应用商店应用错误

问题描述

我正在尝试构建我的第一个 Excel 插件开发项目。我添加了加载项功能区和一个按钮。

当我尝试运行(在调试模式下)时,它给了我以下错误。

无法激活 Windows 应用商店应用程序“Microsoft.Office.Desktop_8wekyb3d8bbwe!Excel”,激活请求失败并出现错误“找不到元素”。

当我打开 Excel 应用程序时,我的插件安装为 COM 插件。 在此处输入图像描述

但我只需要使用我的加载项打开 excel 进行测试。正如其他人建议的那样,我尝试清理解决方案,重新启动机器,删除 obj 和 bin 文件夹,在发布模式下运行项目,然后在调试模式下运行。没有任何效果。

namespace ExcelAddInHW
{
    public partial class ThisAddIn
    {
        private void ThisAddIn_Startup(object sender, System.EventArgs e)
        {
        }

        private void ThisAddIn_Shutdown(object sender, System.EventArgs e)
        {
        }

        #region VSTO generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InternalStartup()
        {
            this.Startup += new System.EventHandler(ThisAddIn_Startup);
            this.Shutdown += new System.EventHandler(ThisAddIn_Shutdown);
        }

        #endregion
    }
}

标签: c#excelvisual-studioexcel-addins

解决方案


推荐阅读