title: Prevent "File format is not valid message" after dropping file on userform
body: <p>I have created Drag-n-Drop form for Excel in order to capture link to file location using treeview control (code bellow). It works as intended, however problem that after I make form <code>ShowModal = False</code> (because user might want to move Excel window in order to reach file-to-be-dragged) after it runs it's routine, error message pops-up informing that &quot;File format is not valid&quot; (screen below) or notification that file might be corrupt or unsafe (second  screen below).</p>
  <p><a href="https://i.stack.imgur.com/DsU23.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DsU23.png" alt="enter image description here" /></a></p>
  <p><a href="https://i.stack.imgur.com/Teguu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Teguu.png" alt="My guess that error depends on the file format" /></a></p>
  <p>To my understanding that happens because Excel considers file to be dropped on the sheet and tries to open it (it will be most likely .pdf file).</p>
  <p>Is there a way to prevent that other than making form <code>Modal</code>? To my understanding to achieve that somehow error message should be prevented or Excel should not try to open file at all and by doing that avoid message altogether (best case).</p>
  <p>Code for Drag-n-Drop functionality:</p>
  <pre><code>Private Sub TreeView1_OLEDragDrop(Data As MSComctlLib.DataObject, Effect As Long, Button As Integer, Shift As Integer, x As Single, y As Single)
  'for capturing draged file path
  'VBA does not have normal native functionality to do that so it is solved by using treeview widget unconventionaly
  
  Dim LinkToPass As String
  
  LinkToPass = Data.Files(1)
  
  MsgBox &quot;Thank you! Link captured.&quot;, vbInformation, &quot;Link captured&quot;
  
  'Pass information to another form, where user enters all other data required
  If formLoaded(&quot;NewEntry_agreement&quot;) Then 
      NewEntry_agreement.LinkToFile.Caption = LinkToPass
  End If
  
  CloseBtt_Click 'just call close button Sub with Unload Me inside
  
  End Sub
  </code></pre>
  <p>EDIT: Additional info and screenshot about alternative message. Also made goal more clear - either prevent message or prevent Excel from trying to open the file and by doing that prevent error message.</p>