Excel加载项-图标消失

问题描述

我创建了一个包含多个宏的Excel加载项。我在.xlam文件中的“ ThisWorkbook”中添加了以下代码。我可以通过开发人员标签上的“ Excel加载项”按钮激活加载项。当我关闭工作簿并备份它时,仍然可以通过“ Excel加载项”按钮激活该加载项,但是宏徽标不再出现在“加载项”选项卡上。知道为什么会这样吗?加载项未被禁用,并且位于受信任的文件位置。

用于在“加载项”标签上创建按钮的代码。

Private Sub Workbook_AddinInstall()

    With Application.CommandBars("Standard").Controls.Add
        .Caption = "Save New Version"
        .FaceId = 3
        .Style = msoButtonIconAndCaptionBelow
        .OnAction = "Version_Save"
    End With
        
    With Application.CommandBars("Standard").Controls.Add
        .Caption = "Create Delivery Workbook"
        .FaceId = 263
        .Style = msoButtonIconAndCaptionBelow
        .OnAction = "DeliveryWorkbook"
    End With

End Sub

当通过“ Excel加载项”按钮停用加载项时,用于从“加载项”选项卡中删除按钮的代码。

Private Sub Workbook_AddinUninstall()

    On Error Resume Next
        Application.CommandBars("Standard").Controls("Save New Version").Delete
        Application.CommandBars("Standard").Controls("Create Delivery Workbook").Delete

End Sub

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...