title: Excel 2003 on 64-bit Windows 7 automatically changes reference to SysWOW64\MSCOMCTL.OCX so 32-bit Excel complains
body: <p>In an Excel 2003 VBA project I am using controls from MSCOMCTL.OCX. That is the VBA project has a reference to System32\MSCOMCTL.OCX.</p>
  
  <p>When I open that project in Excel 2003 on my 64-bit Windows 7 system, Excel automatically changes the reference to SysWOW64\MSCOMCTL.OCX (which is the correct location).</p>
  
  <p>However, when I send that project to my client who is using 32-bit Windows XP, the project complains during opening because SysWOW64\MSCOMCTL.OCX does not exist on his system. </p>
  
  <p>Here are the (unsatisfactory) solutions I came up with so far:</p>
  
  <ol>
  <li><p>Instruct the client to manually change the reference back to the correct location on his system (System32\MSCOMCTL.OCX).</p>
  
  <ul>
  <li>This does not really work for the following reasons: 
  <ol>
  <li>When Excel 2003 32-bit opens the sheet and it cannot find the reference to MSCOMCTL, it removes all the controls that came from the library (e. g. TreeCtrl) from the forms :-(</li>
  <li>Client is struggling with the procedure and it is quite cumbersome for him.</li>
  </ol></li>
  </ul></li>
  <li>Automatically correct the reference using VBA's VBProject.References.AddFromFile/AddFromGuid.
  <ul>
  <li>Same problem as above: When compilation of VBA during opening of workbook fails, Excel will remove all controls that it could not find from the forms.</li>
  </ul></li>
  <li>Automatically add the reference (as in 2.) and use dynamic binding to add all the relevant controls during runtime.
  <ul>
  <li>This could actually work, however currently I am struggling with binding the event handlers to the controls (but that will be separate question ;-)</li>
  </ul></li>
  </ol>
  
  <p>Approaches 1. and 2. do not really solve anything and solution 3 is a lot of work.</p>
  
  <p>Any ideas would be greatly appreciated.</p>