Back

Topic

[KB682]Copy/Paste of a VBA symbol object

Tags: Scripting, VBA

11 years ago
By FABO
Options
Print
Applies to:

PcVue – all versions supporting VBA


Summary:

If VBA symbol code of a duplicated symbol is not executed after a copy/paste, you need to check the symbol configuration.


Details:

The vba code of a sub object is not executed in the new symbol while it still works in the original symbol.

In fact when you click on the symbol, the VBA event is treated by the object script.
But in the new pasted symbol there is no VBA script in the object, there’s only the global vba symbol code.

To copy and paste a good VBA symbol with some sub objects you need to create the first symbol with the following procedure.
First, make sure the sub object is not ticked as a “VBA Control”.

ControlVBA

Then set to FALSE the “EnableEvents” sub object property. It can done via the “Properties” Listbox.

PropertiesList

EnabledEvents

Finally you can link suboject and create your original symbol. After copy/paste, your new symbol executes the vba code of your subobject in the VBA symbol.


Created on: 02 Jan 2014 Last update: 13 May 2024