title: Register a 32-bit COM class for use in 64-bit Python without Administrator rights
body: <p>I'm making a Python script that uses SAP's GUI scripting API through win32com. The first usage is like this:</p>
  
  <pre class="lang-py prettyprint-override"><code>from win32com.client import Dispatch
  objWrapper = Dispatch("SapROTWr.SapROTWrapper")
  </code></pre>
  
  <p>This works fine when using a 32-bit Python interpreter, but not when using a 64-bit interpreter, which gives me a "Class not registered" error. <strong>Is there any way to do this, specially without Administrator privileges?</strong></p>
  
  <p>The default answer will probably be something like <em>"A 64-bit process can't load a 32-bit DLL"</em>, but I suspect it may somehow be done because:</p>
  
  <ol>
  <li><p><a href="https://techtalk.gfi.com/32bit-object-64bit-environment/" rel="nofollow noreferrer">This link</a> mentions a "COM Surrogate" process that may take care of the problem, which by my searches indicate that the DLL itself may be loaded by <code>dllhost.exe</code>. <a href="https://stackoverflow.com/questions/23205162/register-32-bit-com-server-and-generate-tlb-for-use-with-32-bit-and-64-bit-cli#comment35629370_23214785">This answer's comment</a> touches on the method but doesn't solve it.</p></li>
  <li><p>MS Office applications, like Excel for example, does it without problems. Even the hardest part is done, which is allowing a 32-bit application access a 64-bit server. I'm just not sure how this is done, since COM is a bit like black magic and I don't know if I can do this to a third party DLL like SAP's. The lack of Admin rights complicates things further.</p></li>
  <li><p>I <strong>actually am allowed</strong> to use the SAP GUI Scripting API from within Excel (64-bit) VBA. An example module follows, for which I <em>did not</em> have to edit VBA's References:</p></li>
  </ol>
  
  <pre class="lang-vb prettyprint-override"><code>Public Sub SimpleSAP()
    Set SapGuiAuto = GetObject("SAPGUI")  'Get the SAP GUI Scripting object
    Set SAPApp = SapGuiAuto.GetScriptingEngine 'Get the currently running SAP GUI
    Set SAPCon = SAPApp.Children(0) 'Get the first system that is currently connected
    Set session = SAPCon.Children(0) 'Get the first session (window) on that connection
  
    'Start a transaction
    session.StartTransaction "IH01"
  End Sub
  </code></pre>
  
  <p>So, how can I do this from within a Python 64-bit interpreter?</p>