title: Upload document into excel via vba based on doc name
body: <p>I wrote below code, this code upload all document from share drive into excel based on their naming convention.</p>
  
  <p>However it's applicable for Pdf file only. can you please help me that how can i upload other ext file as well like outlook/word/excel?</p>
  
  <pre><code>Dim folderPath As String, fileName As String
  Dim destCell As Range
  
  With Worksheets("ABC")
  folderPath = .Range("F7").Value
  Set destCell = .Range("G12")
  End With
  
  If Right(folderPath, 1) &lt;&gt; "\" Then folderPath = folderPath &amp; "\"
  
  Application.ScreenUpdating = False
  fileName = Dir(folderPath &amp; "ABC*.pdf")
  Do While fileName &lt;&gt; vbNullString
  destCell.Worksheet.OLEObjects.Add _
  fileName:=folderPath &amp; fileName, _
  Link:=False, _
  DisplayAsIcon:=True, _
  IconFilename:="C:\windows\Installer\{AC76BA86-1033-F400-7760-000000000005}\_PDFFile.ico", _
  IconIndex:=0, _
  IconLabel:=fileName, _
  Left:=destCell.Left, _
  Top:=destCell.Top, _
  Width:=150, _
  Height:=5
  Set destCell = destCell.Offset(, 1)
  fileName = Dir
  Loop
  Application.ScreenUpdating = True
  
  MsgBox "Document Uploaded Successfully..!!"
  
  </code></pre>