title: Enforcing Cdate in VBA Excel when retrieving Meta Data
body: <p>I have this code which is successfully returning the 0-5 items of meta data. However, the dates are returning as mixed US and UK formats... I need to enforce Cdate or something similar to get the dates to all read as UK date. (DD/MM/YY) I have usually used Cdate for other things, but unsure how to get it to work....</p>
  <p>Code:</p>
  <pre><code> Dim sFile As Object, obja
  
  'Create Shell Object &amp; NameSpace
  Set oShell = CreateObject(&quot;Shell.Application&quot;)
  Set oDir = oShell.Namespace(&quot;FILEPATH&quot;)
  ActiveSheet.Cells.ClearContents
  
  'Loop thru each File/Folder inside Root Directory
  iRow = 1
  
  For Each sFile In oDir.Items
      iRow = iRow + 1
      
      'Loop thru Each Property
      For i = 0 To 5
          
          'Get File Property Name &amp; Value
          obja = oDir.GetDetailsOf(sFile, i)
          If obja &lt;&gt; &quot;&quot; Then
              iRow = iRow + 1
              'Enter File Property to Sheet
              ActiveSheet.Range(&quot;A&quot; &amp; iRow) = oDir.GetDetailsOf(oDir, i)
              ActiveSheet.Range(&quot;B&quot; &amp; iRow) = obja
          End If
      Next
  Next
  
  MsgBox &quot;Process Completed&quot;
  
   End Sub
  </code></pre>