title: VBA syntax to exclude certain file types
body: <p>I am trying to create a macro that will list all excel spreadsheets in a network folder but ignores any temporary files that excel creates while a spreadsheet is open (ie: ~$filename.xlsx) This code below works great however also picks up these temporary files.</p>
  
  <pre><code>If (objFile) Like ("*.xlsx") Then
              Do something here
          End If
          Next objFile
  </code></pre>
  
  <p>I've tried using an If Not statement but am having trouble getting it to work. I am new to VBA and it could be that my syntax is simply off. Is there a way to specify all .xlsx files while ignoring any temporary ~$*.xlsx files?</p>