記事作成途中につきメモ書き形式です。すみません。
Excelアドインの作成方法
Excelアドインを作成し、リボンUIを実装するための備忘録です。
インターネット上のフリーソフトは使用できない環境向けの、メモ帳さえあればできるやり方です。
手順
Excelでマクロ入りブックを「Excelアドイン(xlam)」として保存
.xlamファイルの拡張子を.zipに変更して解凍ツールで解凍する。
中身を編集
CustomUI
\_rels\.rels
.rels
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
<Relationship Id="R62314067f168429b"
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>
\customUI\customUI14.xml
customUI14.xml
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
<ribbon startFromScratch="false">
<tabs>
<tab id="Tab01" label="Tab01">
<group id="Group01" label="Group01">
<button id="Button01" label="Button01" imageMso="Info" size="large" supertip="これは説明文です。" onAction="test.xlam!Callback" />
<button id="Button02" label="Button02" imageMso="Help" size="large" onAction="test.xlam!Callback" />
</group>
</tab>
</tabs>
</ribbon>
</customUI>
ファイルを作成し、上記の記述が終わったら保存。
再度zipに圧縮(_relsとかdocPropsとかのフォルダ階層で圧縮しないとダメ)して、
拡張子をxlamに戻す。
C:\Users[ユーザー名]\AppData\Roaming\Microsoft\AddIns
フォルダに上書き保存。