新しいこと
お久しぶりです。新しいことを現在始めております。おかげで更新がおろそかに・・・。
えっと、「ネコる。」っていいます。
簡単に言うと、イベントなんかを行う団体です。
http://www.necor.net
まだまだ、立ち上げたばかりで、何をするか決めてませんが、今から面白いことを始める予定です。
是非是非ご期待下さい!
カテゴリー : その他
お久しぶりです。新しいことを現在始めております。おかげで更新がおろそかに・・・。
えっと、「ネコる。」っていいます。
簡単に言うと、イベントなんかを行う団体です。
http://www.necor.net
まだまだ、立ち上げたばかりで、何をするか決めてませんが、今から面白いことを始める予定です。
是非是非ご期待下さい!
ちょっと知り合いからの依頼でエクセルのメニューを作らなくてはいけなくなったので、その記録を。
ちなみにExcelだけではなくWord、PowerPointでも同じ方法で出来るみたいです。(AccessやOutlookは別の方法です。)
まずは適当なモジュールをブックに追加して保存します。
Sub test(control As IRibbonControl) MsgBox "Ribon Menu Test!" End Sub
このとき「マクロ有効ブック(xlsm)」形式で保存しましょう。
※今回は「ribontest.xlsm」で保存しています。
次に、「customUI」フォルダを作成し、その中に「custumUI.xml」というxmlファイルを以下の内容で保存します。
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
<ribbon startFromScratch="false">
<tabs>
<tab id="customTab" label="Custom Tab">
<group id="customGroup" label="Custom Group">
<button id="customButton" label="Custom Button" imageMso="HappyFace"
size="large" onAction="ThisWorkbook.test" />
</group>
</tab>
</tabs>
</ribbon>
</customUI>
先ほど保存した「ribontest.xlsm」のファイル名の後ろに「.zip」を付け足し「ribontest.xlsm.zip」にします。
このとき以下のメッセージが出た場合は「はい」を選択します。

「ribontest.xlsm.zip」に先ほど作成した「customUI.xml」を「customUI」フォルダごとドロップします。
「ribontest.xlsm.zip」フォルダを開き「_rels」フォルダを適当な場所にドロップします。
「_rels」フォルダを開くと「.rels」ファイルがあるので、メモ帳など適当なエディタで開きます。
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"> <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>
このように記述してあるので、以下のコードを<Relationships></Relationships>の間の最後に追加します。
<Relationship Type="http://schemas.microsoft.com/office/2006/relationships/ui/ extensibility" Target="/customUI/customUI.xml" Id="customUIRelID" />
以下のようなコードが出来上がります。
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"> <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"/> <Relationship Type="http://schemas.microsoft.com/office/2006/relationships/ui/ extensibility"Target="/customUI/customUI.xml" Id="customUIRelID" /> </Relationships>
「.rels」ファイルを保存して、「_rels」フォルダごと「ribontest.xlsm.zip」圧縮フォルダにドロップします。
「ribontest.xlsm.zip」のファイル名を「ribontest.xlsm」に戻します。
「ribontest.xlsm」ファイルを開き、リボンメニューに「Custom Tab」というタブが出来ているので、それをクリックし、「Custom Group」の「Custom Button」をクリックします。
以下のメッセージが出てきたら成功です。

【参考にしたホームページ】
●2007 Office Fluent リボンをカスタマイズする (開発者向け) (パート 1/3)
http://msdn.microsoft.com/ja-jp/library/aa338202(office.12).aspx
●あるSEのつぶやき>Excel 2007 アドインでリボンメニューを作成する方法
http://fnya.cocolog-nifty.com/blog/2009/03/excel-2007-e739.html
【送料無料】BRIDGESTONE(ブリヂストン)【TOUR PRO(ツアープロ)1箱(60球) テニスボール【... 価格:6,000円(税込、送料込) |
【送料無料】『1箱ごとにグリップテープ1本プレゼント!』DUNLOP(ダンロップ)【St.JAMES(セン... 価格:6,600円(税込、送料込) |
大きな大会で勝率上げるにはボールに慣れる事です。ご存知伝統のプリンスカップ使用球!プリン... 価格:945円(税込、送料別) |
【送料無料】DUNLOP(ダンロップ)【フォート(FORT)(4個入り)〔30缶〕】テニスボール【あす... 価格:26,400円(税込、送料込) |