title: Using CDO.sys dll for sending messages in VBA freezes Excel
body: <p>I'm facing with a strange problem using CDO.sys for sending email messages from a VBA-enabled Excel application.
  I've used the following code, found at <a href="https://www.rondebruin.nl/win/s1/cdo.htm" rel="nofollow noreferrer">https://www.rondebruin.nl/win/s1/cdo.htm</a> :</p>
  
  <pre><code>Sub SendMailCDO(FSubject As String, FBody As String, FFrom As String, FTo As String, FCc As String)
  
      Dim iMsg As Object
      Dim iConf As Object
      Dim Flds As Variant
  
      Set iMsg = CreateObject("CDO.Message")
      Set iConf = CreateObject("CDO.Configuration")
  
      iConf.Load -1    ' CDO Source Defaults
      Set Flds = iConf.Fields
      With Flds
          .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
          .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "myServerIPAddress"
          .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
          .Update
      End With
  
      With iMsg
          Set .Configuration = iConf
          .To = "mydestination"
          .CC = ""
          .BCC = ""
          .From = FFrom
          .Subject = FSubject
          .TextBody = ""
          .HTMLBody = FBody
          .Send
      End With
      MsgBox ("Email sent to " &amp; FTo)
      Set iMsg = Nothing
      Set iConf = Nothing
      Set Flds = Nothing
  End Sub
  </code></pre>
  
  <p>Now, the code works fine and the emails are sent. However, after the first email is sent, immediately Excel becomes unresponsive on many different commands. For example, normal operations like changing the font dimensions in cells or applying a conditional formatting are not active anymore. In addition, Excel appear slow executing everything.
  The only solution to fix this condition is to close Excel and open it again.
  Any suggestion to fix the problem?
  Thanks in advance,
  Emilio</p>