(圖1)
關閉并保存此工作簿。
Step3:
將RibbonSample.xlsm 重命名為 RibbonSample.xlsm.zip 文件。
雙擊此zip文件(無需關閉zip文件),我們會看到zip容器中包含一名為_rels的文件夾(如圖2所示),將此文件夾解壓縮到桌面上。
(圖2)
以記事本打開方式,打開桌面上_rels文件夾中的.rels XML文件。
內容如下:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Relationships xmlns=""><Relationship Id="rId3" Type="" Target="docProps/app.xml"/><Relationship Id="rId2" Type="" Target="docProps/core.xml"/><Relationship Id="rId1" Type="" Target="xl/workbook.xml"/></Relationships>
為了和此前建立的customUI.xml文件建立聯系,將如下XML語句,
<Relationship Id="someID" Type="" Target="customUI/customUI.xml" />
(注意,ID可以是任意的,但不能重復。Target就是先前我們建立的customUI文件夾和文件。)
插入到</Relationships>之前:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Relationships xmlns=""><Relationship Id="rId3" Type="" Target="docProps/app.xml"/><Relationship Id="rId2" Type="" Target="docProps/core.xml"/><Relationship Id="rId1" Type="" Target="xl/workbook.xml"/>
<Relationship Id="someID" Type="" Target="customUI/customUI.xml" />
</Relationships>
退出并保存此XML文件。
將此_rels文件夾(包含剛修改的.rels文件)替換zip文件容器中的_rels文件夾。
Step4:
將前面已經準備好的customUI文件夾,放入此zip容器(如圖3所示)。
(圖3)
關閉zip文件,將其改名為原來的RibbonSample.xlsm文件名。
Step5:
(圖4)
到此,我們的自定義選項卡就已經大功告成。
新聞熱點
疑難解答