title: VBA - Closing or clicking OK in MsgBox from another workbook,
body: <p>Hi I the following code in Excel VBA, </p>
  
  <pre><code>Sub A ()
      Workbooks.open ("A.xls")
      ActiveWorkbook.Worksheets("1").Select
      ActiveSheet.CommandButton1.value = true
  End Sub
  </code></pre>
  
  <p>I'm opening another workbook (the code inside is protected so I can't modify the workbook "B") and clicking a run button on the worksheet, and it returns a MsgBox with OK button. </p>
  
  <p>I want to know how I can use VBA to close this MsgBox or clicking "OK" ...I tried to use, </p>
  
  <pre><code>`application.DisplayAlert = false` 
  </code></pre>
  
  <p>before opening the workbook "B" but this does not work..</p>
  
  <p>Thanks for your help!</p>