Excel:自定义功能区模板(XLSTART)

问题描述 投票:0回答:2

我已经为Excel功能区创建了一个自定义选项卡,其中包含一个组和一个按钮。这将保存为XLSM文件,打开时按预期工作。

我希望每当打开Excel文档时都会显示此自定义选项卡。 XLSM文件保存在XLSTART文件夹中,并在打开任何Excel文档时启动。问题是打开了2个文档,带有自定义选项卡的XLSM和仅带有标准功能区的单击文件。

我想这是正常的,因为它被认为是一个单独的文件而不是模板;但如果文件保存为模板(测试XLTX和XLTM),Excel根本不会读取它。

  • 双击模板会打开它(问题是让它自动启动)
  • 仅当XLSTART中的文档是模板时才会出现问题
  • 模板中的引用以正确的语言编写
  • 已经在不同的机器上测试过
  • 我正在使用Excel 2016(32位)

我们的想法是在自定义选项卡中为每个需要该工具的用户提供此模板,而无需创建安装可执行文件(在我们的环境中被阻止)并使用excel自动启动。

你有没遇到这个问题或者知道我可能错过的东西?

CustomUi14.xml

<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onL`oad="OnRibbonLoad">
  <ribbon>
    <tabs>
      <tab id="tab0" label="NUEVOVI Tools">
        <group id="grp0" autoScale="true" centerVertically="false" label="Any365 Reports" getVisible ="GetVisible" tag = "RibbonName:=;inMenu:=;CustomTagValue1:=;CustomTagValue2:=;CustomTagValue3:=;CustomPicture:=;CustomPicturePath:=" >
          <button idMso="ChartInsert" showLabel="true" size="large" label="Generate" tag="RibbonName:=;inMenu:=;CustomTagValue1:=;CustomTagValue2:=;CustomTagValue3:=;CustomPicture:=;CustomPicturePath:=" onAction="generateReport" getVisible="GetVisible" getEnabled="GetEnabled" />
        </group>
      </tab>
    </tabs>
  </ribbon>
</customUI>

.rels文件

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="R7f19f805bfb641b9" Type="http://schemas.microsoft.com/office/2007/relationships/ui/extensibility"    Target="customUI/customUi14.xml"/><Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" Target="docProps/app.xml"/><Relationship Id="rId2" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="docProps/core.xml"/><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="xl/workbook.xml"/></Relationships>

文件:http://s000.tinyupload.com/index.php?file_id=76809226544239420467

excel templates ribbon
2个回答
0
投票

Configuring Excel

试试这个

<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="OnRibbonLoad">
  <ribbon startFromScratch="false">
    <tabs>
      <tab id="tab0" label="NUEVOVI Tools" insertBeforeMso = "TabHome" keytip = "G">
        <group id="grp0" autoScale="true" centerVertically="false" label="Any365 Reports" getVisible ="GetVisible" tag = "RibbonName:=;inMenu:=;CustomTagValue1:=;CustomTagValue2:=;CustomTagValue3:=;CustomPicture:=;CustomPicturePath:=" >
          <button idMso="ChartInsert" showLabel="true" size="large" label="Generate" tag="RibbonName:=;inMenu:=;CustomTagValue1:=;CustomTagValue2:=;CustomTagValue3:=;CustomPicture:=;CustomPicturePath:=" onAction="generateReport" getVisible="GetVisible" getEnabled="GetEnabled" />
        </group>
      </tab>
    </tabs>
  </ribbon>
</customUI>

在某些具有许多安全限制的网络上,您可能无法访问XLSTART目录,或者您可能无权保存文件。而是使用您想要的任何名称在您自己的系统上创建一个启动目录,并将book.xltx文件存储在这个新的备用启动目录中。您选择的目录名称无关紧要,但您需要告诉Excel它在哪里。


0
投票

通过将文件保存为XLAM解决了该问题。这使它完美地运作。对于某些(对于我来说未知)原因,模板文件不会从XLSTART forlder加载。

© www.soinside.com 2019 - 2024. All rights reserved.