Hide 2 buttons when 1 Button is selected

Kurt

Well-known Member
Joined
Jul 23, 2002
Messages
1,648
I have the following XML in a Custom Ribbon I have created


<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" ******="RibbonControl******">
<ribbon>
<tabs>
<tab id="tBreakdowns" label="Breakdowns">
<group id="gCustGrp1" label="Breakdowns" >
<button id="bSummary" size="large" label="Summary" imageMso="BlogHomePage"
screentip = "Summary" onAction="CallSummary"
supertip = "Displays the Summary information on the Copy Ready Worksheet"/>
<button id="bFloor" size="large" label="Floor" imageMso="AlignJustify"
screentip = "Floor" onAction="CallFloor"
supertip = "Displays the Floor information on the Copy Ready Worksheet"/>
<button id="bDrawing" size="large" label="Drawing" imageMso="BlogCategories"
screentip = "Drawing" onAction="CallDrawing"
supertip = "Displays the Drawing information on the Copy Ready Worksheet"/>
<button id="bZone" size="large" label="Zone" imageMso="AlignJustifyHigh"
screentip = "Zone" onAction="CallZone"
supertip = "Displays the Zone information on the Copy Ready Worksheet"/>
</group>
<group id="gCustGrp2" label="Import Data" tag="AdminGroup" >
<button id="bChooseImportFile" size="large" label="Choose Import File" imageMso="BlogPublish"
screentip = "Choose the file you need to import"
supertip = "Runs the Choose File macro" onAction="CallChooseFile"/>
<button id="bImportData" size="large" label="Import Data" imageMso="CollapseAll"
screentip = "Import Data" onAction="CallImportRawData"
supertip = "Runs the Import Data macro"/>
<button id="bHidAndSave" size="large" label="Hide Input Save As" imageMso="FileSave"
screentip = "Hide Input tab and Save As" onAction="CallImportRawData"
supertip = "Runs the Import Data macro"/>
</group>
<group id="AlternateBaseFilter" label="Base" >
<button id= "AlternateBase" label = "Alternate" size="large"
onAction="ShowBaseAlternateUserForm" screentip = "Toggles Alternate Values" imageMso="BlackAndWhiteInverseGrayscale"
supertip = "Switches Alternate field values between Alernate and Base" />
</group>
<group id="gInfo" label="Info" >
<button id= "bInfo" label = "Info" size="large"
onAction="ShowInfoForm" screentip = "Information" imageMso="Info"
supertip = "Show information about this file." />
</group>
</tab>
<tab id="tBreakdowns2" label="Breakdowns2">
<group id="gCustGrp3" label="Breakdowns2" >
<button id="bSummary2" size="large" label="Summary" imageMso="BlogHomePage"
screentip = "Summary" onAction="CallSummary"
supertip = "Displays the Summary information on the Copy Ready Worksheet"/>
<button id="bFloor2" size="large" label="Floor" imageMso="AlignJustify"
screentip = "Floor" onAction="CallFloor"
supertip = "Displays the Floor information on the Copy Ready Worksheet"/>
<button id="bDrawing2" size="large" label="Drawing" imageMso="BlogCategories"
screentip = "Drawing" onAction="CallDrawing"
supertip = "Displays the Drawing information on the Copy Ready Worksheet"/>
<button id="bZone2" size="large" label="Zone" imageMso="AlignJustifyHigh"
screentip = "Zone" onAction="CallZone"
supertip = "Displays the Zone information on the Copy Ready Worksheet"/>
</group>
<group id="AlternateBaseFilter2" label="Base" >
<button id= "AlternateBase2" label = "Alternate" size="large"
onAction="ShowBaseAlternateUserForm" screentip = "Toggles Alternate Values" imageMso="BlackAndWhiteInverseGrayscale"
supertip = "Switches Alternate field values between Alernate and Base" />
</group>
<group id="gInfo2" label="Info" >
<button id= "bInfo2" label = "Info" size="large"
onAction="ShowInfoForm" screentip = "Information" imageMso="Info"
supertip = "Show information about this file." />
</group>
</tab>
</tabs>
</ribbon>
</customUI>

When the HideInputSaveAs button is selected I want to hide the Choose Input File, Import File buttons or just show the Breakdowns2 Ribbon.

I have spent the last day and a half really learning a lot of great things on this but I have yet to find something that works.

I have even tried this:

Code:
Sub hide_ribbon()
    Application.ExecuteExcel4Macro "show.toolbar(""Breakdowns"", False)"
End Sub

It will not work.

Any help is always greatly appreciated!
 
Last edited:

Some videos you may like

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop

Kurt

Well-known Member
Joined
Jul 23, 2002
Messages
1,648
'<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
'<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" ******="RibbonControl******">
' <ribbon>
' <tabs>
' <tab id="tBreakdowns" label="Breakdowns">
' <group id="gCustGrp1" label="Breakdowns" >
' <button id="bSummary" size="large" label="Summary" imageMso="BlogHomePage"
' screentip = "Summary" onAction="CallSummary"
' supertip = "Displays the Summary information on the Copy Ready Worksheet"/>
' <button id="bFloor" size="large" label="Floor" imageMso="AlignJustify"
' screentip = "Floor" onAction="CallFloor"
' supertip = "Displays the Floor information on the Copy Ready Worksheet"/>
' <button id="bDrawing" size="large" label="Drawing" imageMso="BlogCategories"
' screentip = "Drawing" onAction="CallDrawing"
' supertip = "Displays the Drawing information on the Copy Ready Worksheet"/>
' <button id="bZone" size="large" label="Zone" imageMso="AlignJustifyHigh"
' screentip = "Zone" onAction="CallZone"
' supertip = "Displays the Zone information on the Copy Ready Worksheet"/>
' </group>
' <group id="gCustGrp2" label="Import Data" tag="AdminGroup" >
' <button id="bChooseImportFile" size="large" label="Choose Import File" imageMso="BlogPublish"
' screentip = "Choose the file you need to import"
' supertip = "Runs the Choose File macro" onAction="CallChooseFile"/>
' <button id="bImportData" size="large" label="Import Data" imageMso="CollapseAll"
' screentip = "Import Data" onAction="CallImportRawData"
' supertip = "Runs the Import Data macro"/>
' <button id="bHidAndSave" size="large" label="Hide Input Save As" imageMso="FileSave"
' screentip = "Hide Input tab and Save As" onAction="CallImportRawData"
' supertip = "Runs the Import Data macro"/>
' </group>
' <group id="AlternateBaseFilter" label="Base" >
' <button id= "AlternateBase" label = "Alternate" size="large"
' onAction="ShowBaseAlternateUserForm" screentip = "Toggles Alternate Values" imageMso="BlackAndWhiteInverseGrayscale"
' supertip = "Switches Alternate field values between Alernate and Base" />
' </group>
' <group id="gInfo" label="Info" >
' <button id= "bInfo" label = "Info" size="large"
' onAction="ShowInfoForm" screentip = "Information" imageMso="Info"
' supertip = "Show information about this file." />
' </group>
' </tab>
' <tab id="tBreakdowns2" label="Breakdowns2">
' <group id="gCustGrp3" label="Breakdowns2" >
' <button id="bSummary2" size="large" label="Summary" imageMso="BlogHomePage"
' screentip = "Summary" onAction="CallSummary"
' supertip = "Displays the Summary information on the Copy Ready Worksheet"/>
' <button id="bFloor2" size="large" label="Floor" imageMso="AlignJustify"
' screentip = "Floor" onAction="CallFloor"
' supertip = "Displays the Floor information on the Copy Ready Worksheet"/>
' <button id="bDrawing2" size="large" label="Drawing" imageMso="BlogCategories"
' screentip = "Drawing" onAction="CallDrawing"
' supertip = "Displays the Drawing information on the Copy Ready Worksheet"/>
' <button id="bZone2" size="large" label="Zone" imageMso="AlignJustifyHigh"
' screentip = "Zone" onAction="CallZone"
' supertip = "Displays the Zone information on the Copy Ready Worksheet"/>
' </group>
' <group id="AlternateBaseFilter2" label="Base" >
' <button id= "AlternateBase2" label = "Alternate" size="large"
' onAction="ShowBaseAlternateUserForm" screentip = "Toggles Alternate Values" imageMso="BlackAndWhiteInverseGrayscale"
' supertip = "Switches Alternate field values between Alernate and Base" />
' </group>
' <group id="gInfo2" label="Info" >
' <button id= "bInfo2" label = "Info" size="large"
' onAction="ShowInfoForm" screentip = "Information" imageMso="Info"
' supertip = "Show information about this file." />
' </group>
' </tab>
' </tabs>
' </ribbon>
'</customUI>
 

Kurt

Well-known Member
Joined
Jul 23, 2002
Messages
1,648
Here is the XML

Code:
|<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" ******="RibbonControl******">
|  <ribbon>
|     <tabs>
|      <tab id="tBreakdowns" label="Breakdowns">
|         <group id="gCustGrp1" label="Breakdowns" >
|             <button id="bSummary" size="large" label="Summary" imageMso="BlogHomePage"
|                     screentip = "Summary" onAction="CallSummary" 
| 			  supertip = "Displays the Summary information on the Copy Ready Worksheet"/>
| 		<button id="bFloor" size="large" label="Floor" imageMso="AlignJustify"
|                     screentip = "Floor" onAction="CallFloor" 
| 			  supertip = "Displays the Floor information on the Copy Ready Worksheet"/>
|  		<button id="bDrawing" size="large" label="Drawing" imageMso="BlogCategories"
| 			  screentip = "Drawing" onAction="CallDrawing"
| 			  supertip = "Displays the Drawing information on the Copy Ready Worksheet"/>          
| 		<button id="bZone" size="large" label="Zone" imageMso="AlignJustifyHigh"
|                     screentip = "Zone" onAction="CallZone"
| 			  supertip = "Displays the Zone information on the Copy Ready Worksheet"/>                    
|         </group>
| 	  <group id="gCustGrp2" label="Import Data" tag="AdminGroup" >
|             <button id="bChooseImportFile" size="large" label="Choose Import File" imageMso="BlogPublish"
|                     screentip = "Choose the file you need to import"
| 			  supertip = "Runs the Choose File macro" onAction="CallChooseFile"/>    
| 		<button id="bImportData" size="large" label="Import Data" imageMso="CollapseAll"
| 			  screentip = "Import Data" onAction="CallImportRawData" 
| 		  	  supertip = "Runs the Import Data macro"/> 
| 		<button id="bHidAndSave" size="large" label="Hide Input Save As" imageMso="FileSave"
| 			  screentip = "Hide Input tab and Save As" onAction="CallImportRawData" 
| 		  	  supertip = "Runs the Import Data macro"/> 
|  	  </group>	
| 	  <group id="AlternateBaseFilter" label="Base" >
|    		<button id= "AlternateBase" label = "Alternate" size="large"  							  
| 			  onAction="ShowBaseAlternateUserForm" screentip = "Toggles Alternate Values" imageMso="BlackAndWhiteInverseGrayscale"
| 			  supertip = "Switches Alternate field values between Alernate and Base" /> 
|   	  </group>
| 	  <group id="gInfo" label="Info" >
|    		<button id= "bInfo" label = "Info" size="large"  							  
| 			  onAction="ShowInfoForm" screentip = "Information" imageMso="Info"
| 			  supertip = "Show information about this file." /> 
|   	  </group>
|       </tab>
|       <tab id="tBreakdowns2" label="Breakdowns2">
|         <group id="gCustGrp3" label="Breakdowns2" >
|             <button id="bSummary2" size="large" label="Summary" imageMso="BlogHomePage"
|                     screentip = "Summary" onAction="CallSummary" 
| 			  supertip = "Displays the Summary information on the Copy Ready Worksheet"/>
| 		<button id="bFloor2" size="large" label="Floor" imageMso="AlignJustify"
|                     screentip = "Floor" onAction="CallFloor" 
| 			  supertip = "Displays the Floor information on the Copy Ready Worksheet"/>
|  		<button id="bDrawing2" size="large" label="Drawing" imageMso="BlogCategories"
| 			  screentip = "Drawing" onAction="CallDrawing"
| 			  supertip = "Displays the Drawing information on the Copy Ready Worksheet"/>          
| 		<button id="bZone2" size="large" label="Zone" imageMso="AlignJustifyHigh"
|                     screentip = "Zone" onAction="CallZone"
| 			  supertip = "Displays the Zone information on the Copy Ready Worksheet"/>                    
|         </group>
| 	  <group id="AlternateBaseFilter2" label="Base" >
|    		<button id= "AlternateBase2" label = "Alternate" size="large"  							  
| 			  onAction="ShowBaseAlternateUserForm" screentip = "Toggles Alternate Values" imageMso="BlackAndWhiteInverseGrayscale"
| 			  supertip = "Switches Alternate field values between Alernate and Base" /> 
|   	  </group>
| 	  <group id="gInfo2" label="Info" >
|    		<button id= "bInfo2" label = "Info" size="large"  							  
| 			  onAction="ShowInfoForm" screentip = "Information" imageMso="Info"
| 			  supertip = "Show information about this file." /> 
|   	  </group>
|       </tab>
|     </tabs>
|   </ribbon>
| </customUI>

Hopefully this works I saw this in another example here on MrExcel that used the | symbol.
 

Kurt

Well-known Member
Joined
Jul 23, 2002
Messages
1,648
Code:
|?xml version="1.0" encoding="UTF-8" standalone="yes"?>customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" ******="RibbonControl******">
  |ribbon>
    |tabs>
      |tab id="tBreakdowns" label="Breakdowns">
        |group id="gCustGrp1" label="Breakdowns" >
            |button id="bSummary" size="large" label="Summary" imageMso="BlogHomePage"
                    |screentip = "Summary" onAction="CallSummary" 
			  |supertip = "Displays the Summary information on the Copy Ready Worksheet"/>
		|button id="bFloor" size="large" label="Floor" imageMso="AlignJustify"
                    |screentip = "Floor" onAction="CallFloor" 
			  |supertip = "Displays the Floor information on the Copy Ready Worksheet"/>
 		|button id="bDrawing" size="large" label="Drawing" imageMso="BlogCategories"
			  |screentip = "Drawing" onAction="CallDrawing"
			  |supertip = "Displays the Drawing information on the Copy Ready Worksheet"/>          
		|button id="bZone" size="large" label="Zone" imageMso="AlignJustifyHigh"
                    |screentip = "Zone" onAction="CallZone"
			  |supertip = "Displays the Zone information on the Copy Ready Worksheet"/>                    
        |/group>
	  |group id="gCustGrp2" label="Import Data" tag="AdminGroup" >
            |button id="bChooseImportFile" size="large" label="Choose Import File" imageMso="BlogPublish"
                    |screentip = "Choose the file you need to import"
			  |supertip = "Runs the Choose File macro" onAction="CallChooseFile"/>    
		|button id="bImportData" size="large" label="Import Data" imageMso="CollapseAll"
			  |screentip = "Import Data" onAction="CallImportRawData" 
		  	  |supertip = "Runs the Import Data macro"/> 
		|button id="bHidAndSave" size="large" label="Hide Input Save As" imageMso="FileSave"
			  |screentip = "Hide Input tab and Save As" onAction="CallImportRawData" 
		  	  |supertip = "Runs the Import Data macro"/> 
 	  |/group>	
	  |group id="AlternateBaseFilter" label="Base" >
   		|button id= "AlternateBase" label = "Alternate" size="large"  							  
			  |onAction="ShowBaseAlternateUserForm" screentip = "Toggles Alternate Values" imageMso="BlackAndWhiteInverseGrayscale"
			  |supertip = "Switches Alternate field values between Alernate and Base" /> 
  	  |/group>
	  |group id="gInfo" label="Info" >
   		|button id= "bInfo" label = "Info" size="large"  							  
			  |onAction="ShowInfoForm" screentip = "Information" imageMso="Info"
			  |supertip = "Show information about this file." /> 
  	  |/group>
      |/tab>
      |tab id="tBreakdowns2" label="Breakdowns2">
        |group id="gCustGrp3" label="Breakdowns2" >
            |button id="bSummary2" size="large" label="Summary" imageMso="BlogHomePage"
                    |screentip = "Summary" onAction="CallSummary" 
			  |supertip = "Displays the Summary information on the Copy Ready Worksheet"/>
		|button id="bFloor2" size="large" label="Floor" imageMso="AlignJustify"
                    |screentip = "Floor" onAction="CallFloor" 
			  |supertip = "Displays the Floor information on the Copy Ready Worksheet"/>
 		|button id="bDrawing2" size="large" label="Drawing" imageMso="BlogCategories"
			  |screentip = "Drawing" onAction="CallDrawing"
			  |supertip = "Displays the Drawing information on the Copy Ready Worksheet"/>          
		|button id="bZone2" size="large" label="Zone" imageMso="AlignJustifyHigh"
                    |screentip = "Zone" onAction="CallZone"
			  |supertip = "Displays the Zone information on the Copy Ready Worksheet"/>                    
        |/group>
	  |group id="AlternateBaseFilter2" label="Base" >
   		|button id= "AlternateBase2" label = "Alternate" size="large"  							  
			  |onAction="ShowBaseAlternateUserForm" screentip = "Toggles Alternate Values" imageMso="BlackAndWhiteInverseGrayscale"
			  |supertip = "Switches Alternate field values between Alernate and Base" /> 
  	  |/group>
	  |group id="gInfo2" label="Info" >
   		|button id= "bInfo2" label = "Info" size="large"  							  
			  |onAction="ShowInfoForm" screentip = "Information" imageMso="Info"
			  |supertip = "Show information about this file." /> 
  	  |/group>
      |/tab>
    |/tabs>
  |/ribbon>
|/customUI>

I hope this works this time!
 

Watch MrExcel Video

Forum statistics

Threads
1,109,349
Messages
5,528,188
Members
409,807
Latest member
nicky736

This Week's Hot Topics

  • Change military grades into rank
    Afternoon all Need help with formula that will change military rank (i.e. 1, 2, 3 into Amn, A1C, SrA). Running IF formula that does not work...
  • VBA COUNTIF SOLUTION
    Hi The following are the errors spread across the several columns from E to Q ie. 13 columns across several sheets with more than 500 rows per...
  • INSERT ROW WITH SPECIFIS TEXT IN A COLUMN
    Hi All! How can identify that that the row to be inserted has to be inserted before 1st row with specific text in column F. If I record the...
  • Auto-Create a monthly Sign in sheet for preschool students
    The image below is what each page looks like. Above is space for the "Child Name" "Month" "Class" School days are obviously Monday-Friday but...
  • VBA vlookup multiple results
    Hi folks, Hopefully someone out there can help. I have a list to vlookup which works (ish). the lookup only picks up the first instance of the...
  • Extract values for earliest/latest times
    I am trying to put together a formula to get the earliest start time, the latest end time from column A for each person in Column B-F without the...
Top