Wednesday, April 29, 2009

Error: "Vuser failed to initialize extension vbascriptext.dll" when replaying a VB or COM script

The user receives the following error while replaying a VB or DCOM script:

"Vuser failed to initialize extension vbascriptext.dll."

Solution

 Troubleshooting vbascriptext.dll error

1. Make sure that VBA is installed properly :
    a. Install the VBA drivers by going to Start -> Programs -> LoadRunner -> Tools -> VBA Setup.
    b. Complete the install and reboot the machine.
    c. Run your script again.

    Note: If you are using older versions of LoadRunner ( before LoadRunner7.5) please contact Customer Support for the VBA setup install.
2. VBA compiler has a limitation of up to 39 characters of the file name. Since Mercury adds additional characters to the script name, it must be 21 characters or less.

3. If the problem persist, try to run your script though the VBA IDE once. To do so:
    a. Bring up your script in VuGen.
    b. Go to Vuser -> Run-time settings -> VBA.
    c. Enable "Debug script through VBA IDE (VuGen only)."
    d. When you run the script, VB IDE should be launched. If not, it means VBA driver was not installed (properly). You might need to reinstall your VBA setup.

4. If step (3) brings you to the line 'Dim objectHelper As New LoadRunnerVbs.ObjectFactory', it is an indication that LoadRunner helper object is not registered. You can manually register lrapihlpr.dll and lrapivbs.dll under the \bin directory. After that, "LoadRunner Protocol Replay Helper" will be checked by default in the Run-Time Settings -> VBA option.

5. Make sure that you are using the VB function correctly. For example, LoadRunner function should be referenced as 'lr.' instead of 'lr_'
    Example: lr.save_string "param_value", "param_name"

6.Check the security-properties of the \bin\vba6_setup\vba6.msi file and make sure 'Everyone' have full permissions on it. Uninstall the VB Addin by right-clicking on vba6.msi file and selecting 'uninstall' and re-install the Add-in.

Note:
1. You might need to reboot your machine after making these changes.
2. For running script on a remote machine, please make sure that you installed the components for the application on all load generator machines.