1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Excelアドインの作り方 ~リボンUIで実装~

Posted at

記事作成途中につきメモ書き形式です。すみません。

Excelアドインの作成方法

Excelアドインを作成し、リボンUIを実装するための備忘録です。
インターネット上のフリーソフトは使用できない環境向けの、メモ帳さえあればできるやり方です。

手順

Excelでマクロ入りブックを「Excelアドイン(xlam)」として保存
image.png

.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に戻す。
image.png

C:\Users[ユーザー名]\AppData\Roaming\Microsoft\AddIns
フォルダに上書き保存。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?