使用 Excel 2010 XLAM 文件

发布于 2024-12-13 06:26:57 字数 199 浏览 2 评论 0原文

我创建了一个 XLAM 文件,它显示一个自定义的功能区选项卡,其中的按钮调用各种宏。

如何在打开另一个 xlsm 文件时自动加载此加载项文件?

目前,显示加载项功能区的唯一方法是先打开 XLAM 文件,然后打开其他 XLSM 文件。只有这样,自定义选项卡才会出现。

我很感激你的帮助。

非常感谢,

KS

I created an XLAM file which displays a customized ribbon tab, the buttons of which call various macros.

How do I get this add-in file to load automatically when opening another xlsm file?

Currently, the only way to display the add-in ribbon is to open the XLAM file first, then open the other XLSM file. Only then will the custom tab appear.

I appreciate your help.

Many thanks,

KS

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

〃安静 2024-12-20 06:26:57

在工作簿的 ThisWorkbook 模块(而不是外接程序)中输入如下内容:

Private Sub Workbook_Activate()
Application.AddIns("MyAddin").Installed = True
End Sub

Private Sub Workbook_Deactivate()
Application.AddIns("MyAddin").Installed = False
End Sub

“已安装”一词有点误导,因为它仅指示外接程序在外接程序菜单中是否已选中或未选中。

如果碰巧功能区仅适用于一本工作簿,您应该将功能区附加到该工作簿。

如果功能区用于多个工作簿,人们通常会采取与您正在执行的操作相反的方法,即创建一个外接程序,在激活特定工作簿(或具有特定特征的工作簿)时使用应用程序级事件打开或关闭菜单或已停用。

In the ThisWorkbook module of the workbook (not the addin) enter something like this:

Private Sub Workbook_Activate()
Application.AddIns("MyAddin").Installed = True
End Sub

Private Sub Workbook_Deactivate()
Application.AddIns("MyAddin").Installed = False
End Sub

The word "Installed" is a bit misleading, as it only indicates whether the addin is checked or unchecked in the Addins Menu.

If by chance the ribbon is only for one workbook you should just attach the ribbon to that workbook.

If the ribbon is for multiple workbooks, people generally take the opposite approach to what you are doing, i.e., create an addin that uses application-level events to turn menus on or off when specific workbooks (or workbooks with a specific characteristics) are activated or deactivated.

兔姬 2024-12-20 06:26:57

如果您将文件添加到 C:\Users[用户]\AppData\Roaming\Microsoft\Excel\XLSTART,它将在您每次打开 Excel 时添加功能区。

If you add the file to C:\Users[user]\AppData\Roaming\Microsoft\Excel\XLSTART it will add the ribbon every time you open Excel.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文