title: Outlook: Save Excel attachment and change file extension
body: <p>I have no prior experience in <code>VBA</code> and found a solution to the first part of my question here.
  So, I was able to make the "Save Excel attachment"-part work with the code below. </p>
  
  <p>Now, since the attachment is a <code>.xls</code> file and gives me a corrupted file message when opening (other worksheets pull data from this saved file), I would like to save it automatically as a .<code>xlsx</code> file. </p>
  
  <p>I tried to find a solution but the things I have tried would not work. Hope to find some help here. Any help would be appreciated! Thanks in advance!</p>
  
  <pre><code>Public Sub saveAttachtoDisk(itm As Outlook.MailItem)
  
      Dim objAtt As Outlook.Attachment
      Dim saveFolder As String
      Dim dateFormat
      dateFormat = Format(itm.ReceivedTime - 1, "yyyymmdd_")    
      saveFolder = "THIS IS MY FOLDER"
  
      For Each objAtt In itm.Attachments
          objAtt.SaveAsFile saveFolder &amp; "\" &amp; dateFormat &amp; objAtt.DisplayName
          Set objAtt = Nothing
         Next    
  
  End Sub
  </code></pre>