Hide/unhide personal ribbon tab.

  • Thread starter Joergen Bondesen
  • Start date
J

Joergen Bondesen

Hi NG.

I have this code for my personal ribbon tabs and it works fine:


<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
<ribbon>
<tabs>
<tab id="MyCustomTab" label="VBA" insertAfterMso="TabHome">

<group id="customGroup1" label="jbs">
<button id="customButton1" label="Ajust Cells" size="large"
onAction="Macro1" imageMso="AccessTableEvents" />
<button id="customButton2" label="Find Letter" size="large"
onAction="Macro2" imageMso="BevelTextGallery" />
<button id="customButton3" label="Bad Hyberlinks" size="large"
onAction="Macro3" imageMso="HyperlinkInsert" />
</group>

</tab>
</tabs>
</ribbon>
</customUI


I have 3 sheets in my file and when sheet 2 and 3 is selected, I want the
tab to be hidden.

What must i add to my code before generate Callbacks and maybe further add
in my vba.


Best regards from

Joergen Bondesen



__________ Information from ESET NOD32 Antivirus, version of virus signature database 4135 (20090606) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com
 
J

Joergen Bondesen

Hi Run

Thanks for reply.

I have downloaded your file.
I have copied the MUDULE: 'RibbonModule' to my file

I have changed my xml code, but it do not work, why?
(I suppose the proble is: idMso)

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<customUI onLoad="ribbonLoaded"
xmlns="http://schemas.microsoft.com/office/2006/01/customui">

<ribbon>

<tabs>

<!-- hide/display My personal Tab -->

<tab idMso="jbTab" getVisible="GetVisible" />

<tab id="jbTab" label="VBA" insertAfterMso="TabHome">


<group id="customGroup1" label="jbs">

<button id="customButton1" label="Ajust Cells" size="large"
onAction="Macro1" imageMso="AccessTableEvents" />

<button id="customButton2" label="Find Letter" size="large"
onAction="Macro2" imageMso="BevelTextGallery" />

<button id="customButton3" label="Bad Hyberlinks" size="large"
onAction="Macro3" imageMso="HyperlinkInsert" />

</group>


</tab>

</tabs>

</ribbon>

</customUI>


Best regards
Joergen Bondesen


Ron de Bruin said:
You can use getvisible to do this

Download the example workbook from my site
You can run the code with the activate/deactivate event of the sheets
http://www.rondebruin.nl/ribbon.htm

See point 3


__________ Information from ESET NOD32 Antivirus, version of virus signature database 4135 (20090606) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com
 
R

Ron de Bruin

I am home and looked at your xml

This will work OK
Call the macro to show your tab


<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<customUI onLoad="ribbonLoaded" xmlns="http://schemas.microsoft.com/office/2006/01/customui">

<ribbon>

<tabs>

<!-- hide/display My personal Tab -->

<tab id="jbTab" label="VBA" insertAfterMso="TabHome" getVisible="GetVisible" >

<group id="customGroup1" label="jbs">

<button id="customButton1" label="Ajust Cells" size="large"
onAction="Macro1" imageMso="AccessTableEvents" />

<button id="customButton2" label="Find Letter" size="large"
onAction="Macro2" imageMso="BevelTextGallery" />

<button id="customButton3" label="Bad Hyberlinks" size="large"
onAction="Macro3" imageMso="HyperlinkInsert" />

</group>


</tab>

</tabs>

</ribbon>

</customUI>

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm
 
J

Joergen Bondesen

Hi Ron.

It works perfect, thanks.
(I can see my mistake now, :cool:)

--
Best regards
Joergen Bondesen


Ron de Bruin said:
I am home and looked at your xml

This will work OK
Call the macro to show your tab


<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<customUI onLoad="ribbonLoaded"
xmlns="http://schemas.microsoft.com/office/2006/01/customui">

<ribbon>

<tabs>

<!-- hide/display My personal Tab -->

<tab id="jbTab" label="VBA" insertAfterMso="TabHome"
getVisible="GetVisible" >

<group id="customGroup1" label="jbs">

<button id="customButton1" label="Ajust Cells" size="large"
onAction="Macro1" imageMso="AccessTableEvents" />

<button id="customButton2" label="Find Letter" size="large"
onAction="Macro2" imageMso="BevelTextGallery" />

<button id="customButton3" label="Bad Hyberlinks" size="large"
onAction="Macro3" imageMso="HyperlinkInsert" />

</group>


</tab>

</tabs>

</ribbon>

</customUI>

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm






__________ Information from ESET NOD32 Antivirus, version of virus
signature database 4136 (20090606) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com



__________ Information from ESET NOD32 Antivirus, version of virus signature database 4136 (20090606) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top