title: Excel VBA "Could not load an object because it is not available on this machine" for a Microsoft Common Control TreeView
body: <p>I have an Excel add-in on a VM that uses the "Microsoft TreeView Control, version 6.0" as a part of Microsoft Windows Common Controls 6.0 (SP6), located at C:\Windows\system32\MSCOMCTL.ocx. The properties window on forms that use the TreeView control show the control as <em>[TreeView control name] TreeView3</em>. Everything works great, and I don't receive any errors.</p>
  
  <p>I also have copies of the working VM with the same Excel add-in, but I receive a Microsoft Forms error that reads "Could not load an object because it is not available on this machine." when I open Excel and the add-in loads.</p>
  
  <p>I am able to re-create the forms, using the same "Microsoft TreeView Control, version 6.0" (same file location and reference), but this TreeView control appears as <em>[TreeView control name] TreeView2</em> and the error no longer appears. </p>
  
  <p>Instead of re-creating all the forms that use the <em>TreeView2</em> control, how can I prevent the issue from happening in the first place? The machines are obviously not exact copies. With the exception of .NET v4 installed on the working machine, I don't know what has changed that corrected the issue. It is my understanding that the Windows Common Controls should not be impacted by simply installing .NET v4 on the machines that have the error.</p>
  
  <p><strong>EDIT:</strong><br>
  Installed the following and it did not work:<br>
  <a href="https://www.microsoft.com/en-us/download/details.aspx?id=10019" rel="nofollow">https://www.microsoft.com/en-us/download/details.aspx?id=10019</a>  </p>
  
  <p>Also took a shot and installed .NET v4, and still no luck.</p>
  
  <p><strong>Specifications on working machine:</strong><br>
  Windows 7 Professional SP1<br>
  Excel 2010, Version: 14.0.7162.5000 (32-bit)<br>
  Computer\HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP and it has v2.0.50727, v3.0, v3.5, and v4</p>
  
  <p><strong>Specifications on machines with the issue:</strong><br>
  Windows 7 Professional SP1<br>
  Excel 2010, Version: 14.0.7162.5000 (32-bit)<br>
  Computer\HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP and it has v2.0.50727, v3.0, v3.5</p>
  
  <p><strong>EDIT #2: failed to mention that the machine with the issue is a 64-bit OS</strong>  </p>
  
  <p><strong>Information from Registry for versions of TreeView controls on Working machine and Non-Working machine</strong>  </p>
  
  <p><em>Working Machine</em><br>
  Computer\HKEY_CLASSES_ROOT\MSComctlLib.TreeCtrl\CurVer - MSComctlLib.TreeCtrl.2  </p>
  
  <p>Computer\HKEY_CLASSES_ROOT\CLSID{C74190B6-8589-11D1-B16A-00C0F0283628}\Version - 2.1</p>
  
  <p>Windows 7 Professional SP1 32-bit  </p>
  
  <p><em>Non-Working Machine</em><br>
  Computer\HKEY_CLASSES_ROOT\MSComctlLib.TreeCtrl\CurVer - MSComctlLib.TreeCtrl.2</p>
  
  <p>Computer\HKEY_CLASSES_ROOT\Wow6432Node\CLSID{C74190B6-8589-11D1-B16A-00C0F0283628}\Version - 2.0 </p>
  
  <p>Windows 7 Professional SP1 64-bit</p>