Symptom
A VBA script instantiating ScriptMuuli with a command like
- CreateObject("VISUM170-64.ScriptMuuli")
- CreateObject("Vision.ScriptMuuli")
or often implemented as
Set muuli1 = CreateObject("VISUM" & VisumVers & bitToken & ".ScriptMuuli")
fails with the error message
"ActiveX component can't create object".
How can I solve this?
Cause
It is highly recommended to replace the functionality of the outdated ScriptMuuli by matrix operations with Python and the procedure "Combination of matrices and vectors" and matrices of type formula.
PTV Visum 2021 was the last release holding ScriptMuuli.dll.
Using PTV Visum 64 bit and VBS ScriptMuuli 64-bit needs to be registered.
Using PTV Visum 32 bit (only until PTV Visum 16) and VBS ScriptMuuli 32-bit needs to be registered.
Using PTV Visum 32/64 bit (only until PTV Visum 16) and Excel VBA 32 bit ScriptMuuli 32 bit needs to be registered:
https://www.ptvgroup.com/en/solutions/products/ptv-visum/knowledge-base/faq/visfaq/show/VIS12348/
Since PTV Visum 16 ScriptMuuli 32-bit is registered by default to enable the often used combination with Excel VBA 32 bit.
Only one ScriptMuuli version can be registered. Check the Windows registry to find out which one.
Resolution
To register the 32-bit version:
Start -> CMD -> Execute as administrator
regsvr32.exe "c:\Program Files\PTV Vision\PTV Visum 16\ScriptMuuli\Win32\ScriptMuuli.dll"
To unregister the 32-bit version:
regsvr32.exe "c:\Program Files\PTV Vision\PTV Visum 16\ScriptMuuli\Win32\ScriptMuuli.dll" /u
To register the 64-bit version:
regsvr32.exe "c:\Program Files\PTV Vision\PTV Visum 16\ScriptMuuli\x64\ScriptMuuli.dll"
For Visum10-Visum13:
The solution is dependent of the Visum release and the operating system (OS), in combination with their 32 or 64 bit architecture.
The attached table
PTV_COM_VBA_instantiating_ScriptMuuli_ActiveX_component_cant_create_object.pdf
lists all possible combinations and which measure should be applied to solve the issue when using the command CreateObject, meeting the concept of late binding.
Alternatively use the Visum.exe as referenced library to meet the early binding concept. An example is included in the attached file
PTV_COM_VBA_instantiating_ScriptMuuli.zip