title: Excel VBA CommandBars
body: <p>I have an Excel-model used for extracting data via S&amp;P Capital IQ Excel-plugin (COM-Addin). This model has been used for a few years without any issues, but now I am getting an error on this line of code:</p>
  
  <pre><code>    Application.CommandBars.FindControl(Tag:="menurefreshdatacell").Execute
  </code></pre>
  
  <p>I have tried searching around and have found that the CommandBars may have been replaced by the Microsoft Office Fluent user interface. However, I cannot seem to find a solution or example of how this may have changed the piece of code from above.</p>
  
  <p>Been a while since i've been using VBA, so unfortunately I have not been able to solve the issue myself, hope to find some more competent people in here. </p>
  
  <p>Below is the entire piece of code. Which selects a designated area, and presses an "Refresh Selection"-button in the plugin.</p>
  
  <p>Let me know if I have left out anything, thank you very much in advance!</p>
  
  <pre><code>    Sub Update_FactSet_formulas()
  
      Application.ScreenUpdating = False
  
      Sheets("Peer group_segments").Select
      Range("PG_seg_data").Select
  
      Application.CommandBars.FindControl(Tag:="menurefreshdatacell").Execute
  </code></pre>
  
  <p>Below is the fomula that is provided by the plugin author, this has not changed for years, and what the above should reflect:</p>
  
  <pre><code>    Public Sub RefreshSelection()
      Dim Refreshbutton As CommandBarButton
      Set Refreshbutton = 
      Application.CommandBars.FindControl(Tag:="menurefreshdatacell")
      Refreshbutton.Execute
  End Sub
  </code></pre>