How to fix the error: file not found: vba.6dll?

Symptoms

When running a VBA macro the following error pops up:

error: "file not found: vba.6dll"

Cause

This is probably caused by the installation of another application that installs VBA 7. This installation can cause corruption of a VBA 6 registry key, that causes an incorrect reference to the VBA 6 dll's.

Solution

A possible solution is suggested on this link: https://www.excelforum.com/excel-programming-vba-macros/666088-file-not-found-vba6-dll.html

If registering VBE6.dll a does not help, have a look at the value of the following registry key:

"HKEY_CLASSES_ROOT\TypeLib\{000204EF-0000-0000-C000-000000000046}\6.0\9\win32"

Maybe it points to a non-existent file, e.g., on a 64 bit system:

C:\\Windows\\SysWOW64\\msvbvm60.dll

In that case, try changing it to:

C:\Program Files (x86)\Common Files\Microsoft Shared\VBA\VBA6\VBE6.DLL