the first VBA macro in a project (thisproject) is not always executed through the execute VBA macro function under specific circumstances

the first VBA macro in a project (thisproject) is not always executed through the execute VBA macro function under specific circumstances

Summary

Under specific circumstances in zenon version 7.10, the first VBA macro from the top is not executed through the "execute VBA macro" function.

When the VBA IDE is opened in the runtime, the macro is visible and can be executed manually in the debugger. When the position of the first and the second VBA macro, are exchanged in "thisproject" the formerly second VBA macro now is no longer executed.

Inserting a "dummy" macro, at the top position, allows executing of all the other VBA macros.

This issue is reproducible in the 32 bit version of the zenon 7.10 runtime and is caused by a bug in the MFC (Microsoft Foundation Classes). The issue does not occur in the 64 bit version of the zenon 7.10 runtime.

Description

Under specific circumstances in zenon version 7.10, the first VBA macro from the top is not executed through the "execute VBA macro" function.

When the VBA IDE is opened in the runtime, the macro is visible and can be executed manually in the debugger. When the position of the first and the second VBA macro, are exchanged in "thisproject" the formerly second VBA macro now is no longer executed.

Inserting a "dummy" macro, at the top position, allows executing of all the other VBA macros.

This issue is reproducible in the 32 bit version of the zenon 7.10 runtime and is caused by a bug in the MFC (Microsoft Foundation Classes). The issue does not occur in the 64 bit version of the zenon 7.10 runtime.

Solution

A workaround for the bug in the MFC has been implemented as a solution for this issue.

As this issue in theory could also occur in zenon 7.0, the workaround has also been implemented in this version. However it must be noted that the issue could not be reproduced in version 7.0 in a test environment under any circumstances.

Information

As a workaround, you can create a dummy macro at the top of "thisproject"



Issue Number: 28639
Fixed on Date: 16.4.2013
Versions: 7.00 0 BUILD 9 | 7.10 0 BUILD 98