Reflection "Error initializing VBA components" When Running Macro

  • 7021398
  • 05-Jan-2012
  • 23-Mar-2021

Environment

Reflection Desktop
Reflection Desktop Pro
Reflection 2014
Reflection Pro 2014
Reflection X 2014
Reflection for IBM 2014
Reflection for UNIX and OpenVMS 2014
Reflection for IBM 2011 R2 or higher
Reflection for UNIX and OpenVMS 2011 R2 or higher
Reflection Standard Suite 2011 R2 or higher
Reflection X 2011 R2 or higher
Reflection Suite for X 2011 R2 or higher

Situation

When you attempt to run a Workspace Macro or Visual Basic for Application file, a Reflection Workspace dialog displays one of the following errors:

View Full Size
2605_1.gif
Reflection Desktop 16.0: "Error initializing VBA components. APC initialization error: ... 80040154 Class not registered ....."

View Full Size
2605_0.gif
"Error initializing VBA components. One of the VBA components is missing or corrupt. VBA needs to be reinstalled."

If the main VBA .msi was installed, but the localized language support for it is not, the error will look like this:

View Full Size
2605_2.gif
"Error initializing VBA components. APC initialization error: Exception from HRESULT: 0x80040502"

Resolution

To resolve the error, you must run the VBA *.msi package and the VBA *.msi language-specific package. These package files are located in the uncompressed Reflection installation image, in the \Prerequisites folder:

  • Reflection Desktop 16.0:
    • VBA Core file: \Prerequisites\VB71\VB71.msi (newer version; see also KB 7021426)
    • Language file: \Prerequisites\VB71\1033\VB71_1033.msi for English (numbers vary for other languages)
  • Reflection 2011:
    • VBA Core file: \Prerequisites\VB65\VBAOF11.msi
    • Language file: \Prerequisites\VB65\nnnn\VBAOF11.msi where nnnn is 1033 for English
If reinstalling the VBA Core and Language files does not resolve the error, try totally removing the VBA components and re-installing them clean.  See TID 7022850 for instructions on how to remove the VBA components.

Cause

This error will occur if you installed Reflection Desktop version 16.0, Reflection 2014 or 2011 R2 or higher from the MSI package file directly, rather than using Setup.exe provided with the product distribution. The error can occur because the VBA installation was removed from the Reflection 2011 R2 or higher *.msi installation (to a separate .msi file) to better manage the VBA components. VBA is installed automatically when using Setup.exe.

Additional Information

Legacy KB ID

This article was originally published as Attachmate Technical Note 2605.