title: Prevent reopening workbook by double clicking if already open
body: <p>I want to prevent opening of the workbook which is already opened.
  My Workbook contains VBA userform.</p>
  
  <p>Event of reopening the workbook is triggered by the double clicking on the workbook icon stored at particular location and the same file was previously open and running VBA userform.</p>
  
  <p>I have tried following code but it is not helping me to prevent reopening.</p>
  
  <pre><code>Private Sub Workbook_Open()
      If ThisWorkbook.IsInplace = True Then
          MsgBox "Workbook Already Open"
          ThisWorkbook.Close (False)
      Else
          MsgBox "Single Instance Open"
      End If
  End Sub
  </code></pre>
  
  <p><strong>Expected Output</strong>:
  When I double click on excel file while file is already open then it should do nothing ideally( or it can override the workbook)</p>
  
  <p><strong>Actual Output</strong>:
  When I double click on excel file while file is already open then it will pop up dialog box "File is already open and reopening of file will discard the changes" with yes , no and cancel option.</p>