title: MailItem.Send in VBA not functioning since Office 365 upgrade
body: <p>We send out a lot of spreadsheets around the organisation, in order to automate this as much as possible we wrote some code to send this automatically and allow us to still put body text in. </p>
  
  <p>This particular Script picks information up from our Finance System (SAP) dumps it into Excel and emails it to the user, it loops through a number times downloading and emailing different data each time. </p>
  
  <p>This works fine on our old windows 7 (Office 2010) machines but some of us have been given new Windows 10 (Office 365) machines to pilot. </p>
  
  <p>The code runs without any error messages but when it gets to .Send it jumps straight to End Sub and does not send the email. </p>
  
  <p>I have tried EmailItem.Display and you can see the email being populated and then just stays visible on the desktop as it loops through the rest of the emails. </p>
  
  <p>Any ideas on how to get round this? I could use the application.send function but I like to have the ability to add custom text into the email body. </p>
  
  <p>Thanks :)</p>
  
  <pre><code>Sub EmailData()
  
  Dim OL As Object
  Dim EmailItem As Object
  Dim y As Long
  Dim TempChar As String
  Dim Bodytext As String
  Dim Flds As Variant
  Dim EmailText As Range
  
  Application.DisplayAlerts = False
  Application.ScreenUpdating = False
  
  'Email Download to nursery
  
  Set OL = CreateObject("Outlook.Application")
  Set EmailItem = OL.Createitem(OLMailItem)
  
  
  'Check File Name is correct
  Filename = Range("A1") &amp; ".xls"
  For y = 1 To Len(Filename)
      TempChar = Mid(Filename, y, 1)
      Select Case TempChar
      Case Is = "/", "\", "*", "?", """", "&lt;", "&gt;", "|"
      Case Else
          SaveName = SaveName &amp; TempChar
      End Select
  Next y
  ActiveSheet.Cells.Copy
  Workbooks.Add
  Selection.PasteSpecial Paste:=xlValues
  Selection.PasteSpecial Paste:=xlFormats
  With ActiveWindow
      .DisplayGridlines = False
      .DisplayZeros = False
  End With
  Range("A1:S38").Select
  Selection.Locked = True
  Selection.FormulaHidden = False
  Set EmailText = ActiveSheet.Range("AB1:AB5").SpecialCells(xlCellTypeVisible)
  
  ActiveSheet.Protect ("keepsafe")
  ActiveWorkbook.SaveAs Networkpath &amp; "\" &amp; SaveName, , "", , True
  ActiveWorkbook.ChangeFileAccess xlReadOnly
  
  
   EmailItem.display
  
  'On Error Resume Next
  With EmailItem
  .To = "Daston@blahblah.uk"
  '.To = Range("AA1")
  .CC = ""
  .BCC = ""
  .Subject = Filename
  .HTMLBody = RangetoHTML(EmailText)
  .Attachments.Add ActiveWorkbook.FullName
  
  .send
  End With
  
  Application.Wait (Now + TimeValue("0:00:02"))
  
  Kill Networkpath &amp; "\" &amp; SaveName
  ActiveWorkbook.Close False
  
  
  Set OL = Nothing
  Set EmailItem = Nothing
  
  End Sub
  </code></pre>