mhammond / pywin32

Python for Windows (pywin32) Extensions
5.01k stars 792 forks source link

Unable to Use Active Scripting Engine with pywin32 #2136

Closed daddun closed 1 year ago

daddun commented 1 year ago

The active scripting engine should be successfully registered and accessible for use with MSScriptControl.ScriptControl.

Upon running \Python\Python312-32\Lib\site-packages\win32comext\axscript\client\pyscript.py, the registration of the active scripting engine prompts for elevation and a retry occurs. The following registration is confirmed: Python. However, when attempting to invoke the Python script engine using MSScriptControl.ScriptControl, the following unhandled exception is thrown: 0x800a017c - ScriptControl: A script engine for the specified language cannot be created.

Execute \Python\Python312-32\Lib\site-packages\win32comext\axscript\client\pyscript.py. Observe the elevation request and retry. Confirm the registration of the Python engine. Attempt to invoke the Python script engine using MSScriptControl.ScriptControl.

Python: 3.12 pywin32: 306 pywin32 wheel: pywin32-306-cp312-cp312-win32.whl System: Windows 11 Professional Edition, 22H2