title: Excel VBA hiding custom ribbon tab
body: <p>I have a custom ribbon which works fine but I only want to enable it and have my add in show for certain workbooks so I check for the workbook title on load and try to use the Invalidate method if the condition is false. Unfortunately nothing happens the custom ribbon tab is still showing.</p>
  
  <p>The following is my sub:</p>
  
  <pre><code>Public Sub loadMyRibbon(ribbon As IRibbonUI)
  
      Set RibUI = ribbon
  
      If Not workbookTitle = "My Workbook" Then
          If Not RibUI Is Nothing
              RibUI.Invalidate
              MsgBox "Not Working"
          End If
      End If
  
  End Sub 
  </code></pre>
  
  <p>Which seems correct to me from reading through the method documentation:
  <a href="http://msdn.microsoft.com/en-us/library/office/aa433552%28v=office.12%29.aspx" rel="nofollow">Microsoft Documentation</a></p>
  
  <p>I see my MsgBox message displayed on the screen so I know the code is executing correctly up to that point but RibUI.Invalidate doesn't hide my tab. Appreciate any pointers!</p>
  
  <p>I have also tried:</p>
  
  <pre><code>RibUI.InvalidateControl "myTag"
  </code></pre>
  
  <p>But this also doesn't work</p>