Back

Topic

[KB158]Incompatibility between VBA 6.2 and VBA 6.4

Tags: Scripting, VBA

14 years ago
By RM
Options
Print
Applies to:

PcVue version 8.00 SP3 onwards.


Summary:

This article identifies and gives a work-around for an incompatibility between versions 6.2 and 6.4 of Microsoft VBA.


Solution:

Until version 8.00 SP3 (including version 7.20x), PcVue used version 6.2 of Microsoft VBA.

Since version 8.00 SP3, PcVue uses Microsoft VBA version 6.4.

That change gave rise to upward compatibility problems (with ActiveX for instance) as follows.

Situation

  • A project is developed with PcVue 8.00 with VBA, using ADO ActiveX .
  • When it is started in PcVue 8.00 SP3, it no longer works.

Diagnosis

This is a Microsoft limitation that is found with some ActiveX only. It happens because the VBA project is not loaded and all the application VBA code (associated with mimics etc.) is not loaded either.

The reason is that by default a mimic is saved in binary format. The VBA code includes a COM (Component Object Model) reference to the ActiveX, which is also held in binary. However Microsoft VBA 6.4 cannot read the binary reference of ActiveX saved from VBA 6.2.

Work-around for PcVue

  1. Open the project with version of PcVue with which it was developed (e.g. 7.20x or 8.00).
  2. Save the mimic in ASCII format.
Note If required you can change the default options for saving all mimics from Binary to ASCII (in the menu Configure\HMI Options\Files Format\Mimics).
  1. Restart the project with version 8.00 SP3 or later
  2. Check that its VBA scripts run.
  3. The mimics can be converted back to binary format in the same manner if required.

For further information

In the main Help, see the topic Developing the HMI.ActiveX Controls.Saving a Mimic Containing an ActiveX Control In ASCII Format.


Created on: 05 Nov 2010 Last update: 04 Sep 2024