[IronPython] Creating PythonEngine in VB6

J. Merrill jvm_cop at spamcop.net
Wed Oct 12 17:39:20 CEST 2005

If you have more than one version of .Net installed, it could be that the "wrong" version has been started.  This article discusses getting that same error code:


and points to this MSDN article that shows how you could use an application configuration file (for your VB6 app, presumably) to require the .Net version used by IronPython:


Good luck...

At 04:47 PM 10/1/2005, Patrick Haener wrote
>I am trying to use IronPython to script .Net classes with VB6 from within Excel.
>The VB6  function below should create a Python engine, but throws a runtime error 80131604.
>Function NewIronPythonInterpreter() As IronPython.PythonEngine
>Dim rt As New mscoree.CorRuntimeHost
>Dim unk As IUnknown
>rt.GetDefaultDomain unk
>Dim ad As AppDomain
>Set ad = unk
>' creating a BasicConsole object works
>Dim x As IronPython.BasicConsole
>Set x = ad.CreateInstanceFrom(IronPythonAssembly, "IronPython.Hosting.BasicConsole").Unwrap
>Dim r As IronPython.PythonEngine
>' Creating a Python engine generates a Runtime error # 80131604
>Set r = ad.CreateInstanceFrom(IronPythonAssembly, "IronPython.Hosting.PythonEngine").Unwrap
>Set NewIronPyt

J. Merrill / Analytical Software Corp

More information about the Ironpython-users mailing list