title: CreateObject("Outlook.Application") not working on some computers with Office 365
body: <p>I have a client site running our Windows desktop software on a number of computers with 64 bit Office 365.</p>
  <p>On most of their computers, our software is able to send email via Outlook.</p>
  <p>However, two of their computers were upgraded to 365 last year (by their IT technician, not us), and both fail when they attempt to send email from our software.</p>
  <p>Outlook works fine on its own, and so does our software - on both of these computers. But these two both can't send email from our software. (The other computers, which send email fine, are running exactly the same version of our software.)</p>
  <p>When sending email, our software first checks for the existence of &quot;Outlook.Application&quot; or &quot;Outlook.Application.*&quot; keys in the Windows Registry to determine whether Outlook is installed. If not found, our program logic assumes that Outlook isn't installed, and attempts to use MAPI instead to send mail through another email client like Thunderbird (or through Outlook using MAPI).  However, these computers both then crashed, because MAPI doesn't work on 64bit computers.</p>
  <p>When I investigated these two problem computers, I found that they both had no &quot;Outlook.Application&quot; or &quot;Outlook.Application.16&quot; keys anywhere in their Windows Registry. I have never encountered this before.  How and why would Office 365 install without creating these Registry entries?  (I had just installed Office 365 on two computers here in my office, and they both had these keys and worked perfectly.  And we have never encountered this before, at any of our other user sites.)</p>
  <p>I discussed this with their IT technician. He did a complete uninstall of Office 365, and installed them from scratch, using the &quot;on-line&quot; install (that I had used on my computers - I sent him the URL to be sure). However, after this they were still unable to send email. When I investigated, I found that the Registry keys were still missing.</p>
  <p>Their IT technician then asked me to export all the &quot;Outlook.Application&quot; and &quot;Outlook.Application.16&quot; keys in &quot;Computer\HKEY_CLASSES_ROOT&quot; and send them to him. He imported these on both those computers, but it did not fix the problem.</p>
  <p>However, because the keys now existed, our software then attempted to send email directly through Outlook, using OLE. However it crashed on the line where it tried to create an Outlook Application Object:</p>
  <pre><code>loApp = CreateObject(&quot;Outlook.Application.16&quot;)
  </code></pre>
  <p>I built a special version with some extra test code in it.  After failing to run the above line, it tried to run a line:</p>
  <pre><code>loApp = CreateObject(&quot;Outlook.Application&quot;)
  </code></pre>
  <p>This also failed - presumably because some Outlook application components have not been installed.</p>
  <p>I did some fairly extensive Google searches for posts that might identify a solution, but found nothing that seemed to fit.  A couple of posts suggested running an Office &quot;Repair&quot; from the installation tool.</p>
  <p>I mentioned this to their technician, and he did this.  Interestingly, when I then checked (using RegEdit), it had created a lot more &quot;Outlook.Application&quot; and &quot;Outlook.Application.16&quot; Registry keys.  But our software still fails on both the &quot;CreateObject&quot; lines in that test version, and single &quot;CreateObject&quot; line in the normal version.</p>
  <p>Both their technician and I are completely mystified (and now out of our depth in the Microsoft black arts of Office 365 installation and Windows).</p>
  <p>Has anyone encountered this scenario before, and / or can suggest where we might go from here?</p>
  <hr />
  <p>OK, the original post was getting a bit long, and I didn't want to clutter it with too much information.  So here is some further info:</p>
  <p>In answer to Eugene's questions:</p>
  <ol>
  <li>Using RegEdit, I searched the entire Registry - for one of the
  computers that didn't work, and one that did (plus my own here,
  which also worked fine).</li>
  <li>Their technician installed the latest 64 bit 365. If I understand
  correctly, the initial install was done from an ISO file. When that
  didn't work, he tried again using the &quot;on line&quot; install (which I had
  successfully used here). He used the &quot;on line&quot; install again for the &quot;repair&quot;.  I don't have current build numbers, but could obtain these later in the week if relevant.  But they should be up-to-date.</li>
  <li>No we can't reproduce the problem ourselves in-house, and have never
  seen it before at any other client site.</li>
  <li>The site is running the same antivirus software on all computers (those
  that work, and those that don't). So I suspect that this won't be
  the cause.</li>
  </ol>
  <p>Registry keys that match perfectly on those two computers are:</p>
  <pre><code>Computer\HKEY_CLASSES_ROOT\CLSID\{0006F03A-0000-0000-C000-000000000046}
  Computer\HKEY_CLASSES_ROOT\Outlook.Application
  Computer\HKEY_CLASSES_ROOT\Outlook.Application.16
  Computer\HKEY_CLASSES_ROOT\WOW6432Node\CLSID\{0006F03A-0000-0000-C000-000000000046}
  
  Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{0006F03A-0000-0000-C000-000000000046}
  Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Outlook.Application
  Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Outlook.Application.16
  Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\WOW6432Node\CLSID\{0006F03A-0000-0000-C000-000000000046}
  
  Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\ClickToRun\AppVMachineRegistryStore\Integration\Backup\Software\RegisteredApplications
  Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\ClickToRun\AppVMachineRegistryStore\Integration\Ownership\Software\Classes\Outlook.Application
  Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\ClickToRun\AppVMachineRegistryStore\Integration\Ownership\Software\Classes\Outlook.Application.16
  Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\ClickToRun\AppVMachineRegistryStore\Integration\Ownership\Software\RegisteredApplications
  
  Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\ClickToRun\REGISTRY\MACHINE\Software\Classes\CLSID\{0006F03A-0000-0000-C000-000000000046}
  Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\ClickToRun\REGISTRY\MACHINE\Software\Classes\Outlook.Application
  Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\ClickToRun\REGISTRY\MACHINE\Software\Classes\Outlook.Application.16
  Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\ClickToRun\REGISTRY\MACHINE\Software\Classes\Wow6432Node\CLSID\{0006F03A-0000-0000-C000-000000000046}\InprocServer32
  Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\ClickToRun\REGISTRY\MACHINE\Software\RegisteredApplications
  Computer\HKEY_LOCAL_MACHINE\SOFTWARE\RegisteredApplications
  Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Classes\CLSID\{0006F03A-0000-0000-C000-000000000046}
  Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\RegisteredApplications
  </code></pre>
  <p>Something that may be significant:
  The Windows Registry on the computer that does not work has four extra keys (that are not in the computer that does work):</p>
  <pre><code>Computer\HKEY_CLASSES_ROOT\PackagedCom\ProgIdIndex\Outlook.Application
  Computer\HKEY_CLASSES_ROOT\PackagedCom\ProgIdIndex\Outlook.Application\Microsoft.Office.Desktop.Outlook_16051.12325.20298.0_x86__8wekyb3d8bbwe
  Computer\HKEY_CLASSES_ROOT\PackagedCom\ProgIdIndex\Outlook.Application.16
  Computer\HKEY_CLASSES_ROOT\PackagedCom\ProgIdIndex\Outlook.Application.16\Microsoft.Office.Desktop.Outlook_16051.12325.20298.0_x86__8wekyb3d8bbwe
  </code></pre>
  <p>That computer (which doesn't work) also has a folder C:\ProgramData\Packages\Microsoft.Office.Desktop.Outlook_8wekyb3d8bbwe\ with 3 subfolders in it (with system generated names):</p>
  <ul>
  <li>The first (created in 2019) has a subfolder &quot;\SystemAppData&quot; which is
  empty.</li>
  <li>The other two (both with same date/time in early 2020) are completely
  empty (i.e. have no SystemAppData subfolder)</li>
  </ul>
  <p>I wonder whether these keys may somehow be causing mischief. Early next week the technician and I plan to back up these keys, and then delete them.</p>
  <p>Does anyone know what these keys are about?
  (I found a blog that may be relevant:  <a href="https://blogs.windows.com/windowsdeveloper/2017/04/13/com-server-ole-document-support-desktop-bridge/" rel="nofollow noreferrer">https://blogs.windows.com/windowsdeveloper/2017/04/13/com-server-ole-document-support-desktop-bridge/</a>   But then again, it may not be.)</p>