Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default My Custom Tab does not show up in Excel 2007

Hi everyone. I'm very new in Excel 2007 UI.
I'm about to create a worksheet with a customized tab/ribbon, so I referred
to this link:
http://msdn.microsoft.com/en-us/library/aa338205.aspx
and followed the steps described at the part, "Modifying Office XML Formats
Files to Customize the Ribbon User Interface".
But "My Tab" did not appear from the Ribbon UI.
Did I miss doing anything?

Thanks in advance! :)
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default FOLLOW-UP: My Custom Tab does not show up in Excel 2007

To clearly explain how I created the workbook, here are the steps that I
made, based on the MSDN site:

1. I created a new workbook and saved it as "Custom.xlsm"
2. I opened the VB Editor and in "ThisWorkbook", added the ff. code:

Sub MyButtonMacro(ByVal ControlID As IRibbonControl)
Msgbox("Hello world")
End Sub

3. I saved the worksheet.
4. At my own specified folder, I created a folder, "customUI".
5. Under the "customUI" folder, I created an xml file called "customUI.xml"
having the ff. code:

<?xml version="1.0" encoding="utf-8" ?
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"
<ribbon startFromScratch="true"
<tabs
<tab id=":CustomTab" label="My Tab"
<group id="SimpleControls" label="Sample Group"
<button id="Button1" size="large" label="Large Button"
onAction="ThisWorkbook.MyButtonMacro" /
</group
</tab
</tabs
</ribbon
</customUI

6. I renamed "Custom.xlsm" to "Custom.xlsm.zip" to see the contents.
7. I added my "customUI" folder (together with the file under it) into the
zip file, just directly under "Custom.xlsm.zip".
8. I extracted the ".rels" file which is under the "_rels" folder in the zip
file.
9. I modified the ".rels" file to add the ff. xml tag as another item under
the "Relationships" tag:

<Relationships
....
<Relationship Id="someID"
Type="http://schemas.microsoft.com/office/2006/relationships/ui/extensibility" Target="customUI/customUI.xml" /
</Relationships

10. I added the ".rels" file back into the zip file, under the "_rels"
folder, overwriting the existing file.
11. I renamed the zip file back into "Custom.xlsm" and opened it.

However, after accomplishing these steps, I did not see "My Tab" at the UI. :(
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,420
Default FOLLOW-UP: My Custom Tab does not show up in Excel 2007

I couldn't get this method to work I must admit.

First, a file with macros should be saved as xlam not xlsm.

Second, get hold of a copy of the CustonUI Editor,
http://openxmldeveloper.org/articles...muieditor.aspx. With this, open
the xlam file and plug the XML in there. You can validate the XML for
well-formedness (sic!), and generate callbacks, but mainly it plugs it in
properly.

Then try the xlam in 2007.

--
__________________________________
HTH

Bob

"jean grey" wrote in message
...
To clearly explain how I created the workbook, here are the steps that I
made, based on the MSDN site:

1. I created a new workbook and saved it as "Custom.xlsm"
2. I opened the VB Editor and in "ThisWorkbook", added the ff. code:

Sub MyButtonMacro(ByVal ControlID As IRibbonControl)
Msgbox("Hello world")
End Sub

3. I saved the worksheet.
4. At my own specified folder, I created a folder, "customUI".
5. Under the "customUI" folder, I created an xml file called
"customUI.xml"
having the ff. code:

<?xml version="1.0" encoding="utf-8" ?
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"
<ribbon startFromScratch="true"
<tabs
<tab id=":CustomTab" label="My Tab"
<group id="SimpleControls" label="Sample Group"
<button id="Button1" size="large" label="Large Button"
onAction="ThisWorkbook.MyButtonMacro" /
</group
</tab
</tabs
</ribbon
</customUI

6. I renamed "Custom.xlsm" to "Custom.xlsm.zip" to see the contents.
7. I added my "customUI" folder (together with the file under it) into the
zip file, just directly under "Custom.xlsm.zip".
8. I extracted the ".rels" file which is under the "_rels" folder in the
zip
file.
9. I modified the ".rels" file to add the ff. xml tag as another item
under
the "Relationships" tag:

<Relationships
...
<Relationship Id="someID"
Type="http://schemas.microsoft.com/office/2006/relationships/ui/extensibility"
Target="customUI/customUI.xml" /
</Relationships

10. I added the ".rels" file back into the zip file, under the "_rels"
folder, overwriting the existing file.
11. I renamed the zip file back into "Custom.xlsm" and opened it.

However, after accomplishing these steps, I did not see "My Tab" at the
UI. :(



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default FOLLOW-UP: My Custom Tab does not show up in Excel 2007

I got it working.
First I removed the XML declaration in customUI.xml (the one containing the
XML version, etc.)
Then I specified the location by adding "insertAfterMso="TabHome" at the
"tab" tag so that "My Tab" will appear after "Home".

BTW, xlsm files can also run macros. xlsm's are macro-enabled workbooks,
while xlam's are macro-enabled add-ins, as explain in MSDN:

http://msdn.microsoft.com/en-us/library/aa338205.aspx


"Bob Phillips" wrote:

I couldn't get this method to work I must admit.

First, a file with macros should be saved as xlam not xlsm.

Second, get hold of a copy of the CustonUI Editor,
http://openxmldeveloper.org/articles...muieditor.aspx. With this, open
the xlam file and plug the XML in there. You can validate the XML for
well-formedness (sic!), and generate callbacks, but mainly it plugs it in
properly.

Then try the xlam in 2007.

--
__________________________________
HTH

Bob

"jean grey" wrote in message
...
To clearly explain how I created the workbook, here are the steps that I
made, based on the MSDN site:

1. I created a new workbook and saved it as "Custom.xlsm"
2. I opened the VB Editor and in "ThisWorkbook", added the ff. code:

Sub MyButtonMacro(ByVal ControlID As IRibbonControl)
Msgbox("Hello world")
End Sub

3. I saved the worksheet.
4. At my own specified folder, I created a folder, "customUI".
5. Under the "customUI" folder, I created an xml file called
"customUI.xml"
having the ff. code:

<?xml version="1.0" encoding="utf-8" ?
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"
<ribbon startFromScratch="true"
<tabs
<tab id=":CustomTab" label="My Tab"
<group id="SimpleControls" label="Sample Group"
<button id="Button1" size="large" label="Large Button"
onAction="ThisWorkbook.MyButtonMacro" /
</group
</tab
</tabs
</ribbon
</customUI

6. I renamed "Custom.xlsm" to "Custom.xlsm.zip" to see the contents.
7. I added my "customUI" folder (together with the file under it) into the
zip file, just directly under "Custom.xlsm.zip".
8. I extracted the ".rels" file which is under the "_rels" folder in the
zip
file.
9. I modified the ".rels" file to add the ff. xml tag as another item
under
the "Relationships" tag:

<Relationships
...
<Relationship Id="someID"
Type="http://schemas.microsoft.com/office/2006/relationships/ui/extensibility"
Target="customUI/customUI.xml" /
</Relationships

10. I added the ".rels" file back into the zip file, under the "_rels"
folder, overwriting the existing file.
11. I renamed the zip file back into "Custom.xlsm" and opened it.

However, after accomplishing these steps, I did not see "My Tab" at the
UI. :(




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,420
Default FOLLOW-UP: My Custom Tab does not show up in Excel 2007



"jean grey" wrote in message
...

BTW, xlsm files can also run macros. xlsm's are macro-enabled workbooks,
while xlam's are macro-enabled add-ins, as explain in MSDN:

http://msdn.microsoft.com/en-us/library/aa338205.aspx



Sorry, you are right of course, I was getting ahead of myself.

You should get the CustomUI Editor though, it makes life a little easier.




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help w using custom image for custom toolbar in Excel 2007 vbaexperimenter Excel Programming 10 June 23rd 08 06:05 PM
2003 - 2007 custom macro and custom button restore. Scott Sornberger Excel Discussion (Misc queries) 11 May 23rd 08 02:41 PM
Excel 2003 Add-in with C# and VSTO 2005 doesn't show custom menu Peder Myhre Excel Programming 1 February 4th 08 09:16 PM
How do I show 2007 custom Button Images with transparent backgroun JeffreyW Excel Programming 0 December 9th 07 09:13 PM
How do I get custom views created in Excel 2K to show in Excel 200 Tina Bradshaw Excel Worksheet Functions 0 September 7th 05 08:28 PM


All times are GMT +1. The time now is 09:30 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"