Variables association error in child project

Variables association error in child project

I'm working with Zenon 6.51 SP0 Build 0.
In the Editor I have a tree structure composed of a parent project and three children projects.
I created a wizard to automatically create variables when a symbol is dragged into a graphic page.
My wizard is composed of a window where I can insert the variable name, the project where I want the variables to be created (in the father or a son), data type etc. (See attachment)
Finally, the wizard allows you to associate variables created with the properties of my symbol.
The symbol is present in the parent project and the problem arises when I want to create variables in a child project: the variables are created correctly, but they are not associated with the properties of my symbol.
This does not happen if the variables are created in the parent project.
Here is the code of my function:
VBA Code:
Private Sub pbOk_Click()
On Error GoTo Error

Dim newNormalVar As Variable
Dim newVeryLowVar As Variable
Dim newLowVar As Variable
Dim newHighVar As Variable
Dim newOverflowVar As Variable
Dim newDisableVar As Variable
Dim newVeryLowAlarmsVar As Variable
Dim newLowAlarmsVar As Variable
Dim newHighAlarmsVar As Variable
Dim newOverflowAlarmsVar As Variable
Dim newInvalidVar As Variable
Dim newSimuVar As Variable
Dim vProps As Variant
Dim it As Integer
Dim strProp() As String

'Check if variable name already exists
Dim found As Boolean
Dim nIndex As Long
For nIndex = 0 To MyWorkspace.Application.Projects.Item(cbProjects.Text).Variables.Count - 1
If MyWorkspace.Application.Projects.Item(cbProjects.Text).Variables.Item(nIndex).name = tbVarName.Text & "_Normal" Then
found = True
Exit For
End If
Next nIndex

Dim varName As String
varName = tbVarName.Text

'If variable name doesn't exist create variables
If Not found Then
Dim varDriver As Driver
Set varDriver = MyWorkspace.Application.Projects.Item(cbProjects.Text).Drivers.Item(cbDriver.Text)

Dim varChannelType As Integer
varChannelType = GetChannelType(cbObjectType.Text)

Dim varDataType As VarType
Set varDataType = MyWorkspace.Application.Projects.Item(cbProjects.Text).VarTypes.Item("BOOL")

Dim disableName As String
disableName = varName & "_Enable"

Dim cmdName As String
cmdName = varName & "_CMD"

Dim remName As String
remName = varName & "_REM"

Dim simuName As String
simuName = varName & "_Simulation"

Dim internalDriver As Driver
Set internalDriver = MyWorkspace.Application.Projects.Item(cbProjects.Text).Drivers.Item("Variabili Interne")

Dim mathDriver As Driver
Set mathDriver = MyWorkspace.Application.Projects.Item(cbProjects.Text).Drivers.Item("Variabili matematiche")

Dim boolVarType As VarType
Set boolVarType = MyWorkspace.Application.Projects.Item(cbProjects.Text).VarTypes.Item("BOOL")

Dim nChannelType As Integer
nChannelType = tpVirtuellOnlBerechnen 'this is equal to: obKanaltyp = 17

Dim internChannelType As Integer
internChannelType = GetChannelType("Internal variable")

Dim invIdx As Integer
Dim t As Boolean
Dim typeFound As Boolean
Dim nClassCurrentAmount As Integer
Dim nLastColor As Double
Dim strLastClassName As String

Set newNormalVar = MyWorkspace.Application.Projects.Item(cbProjects.Text).Variables.CreateVar(varName & "_Normal", varDriver, varChannelType, varDataType)
newNormalVar.Tagname = varName

Dim invalidName As String
invalidName = varName & "_Invalid"
Set newInvalidVar = MyWorkspace.Application.Projects.Item(cbProjects.Text).Variables.CreateVar(invalidName, mathDriver, nChannelType, varDataType)

If ckbVeryLow.value = True Then
Set newVeryLowVar = MyWorkspace.Application.Projects.Item(cbProjects.Text).Variables.CreateVar(varName & "_VeryLow", varDriver, varChannelType, varDataType)
newVeryLowVar.Tagname = varName
Dim veryLowAlarmName As String
veryLowAlarmName = varName & "_VeryLow_Alarm"
MyWorkspace.Application.Projects.Item(cbProjects.Text).Variables.DeleteVar (veryLowAlarmName)
Set newVeryLowAlarmsVar = MyWorkspace.Application.Projects.Item(cbProjects.Text).Variables.CreateVar(veryLowAlarmName, mathDriver, nChannelType, varDataType)
newVeryLowAlarmsVar.Tagname = varName
newVeryLowAlarmsVar.DynProperties("AreaName") = cbAlarmArea.Text

'add Source Variable (i.e. Boolean from Internal driver - has to exist already)
newVeryLowAlarmsVar.CreateDynProperty ("MathInfo[0].SourceVars")
newVeryLowAlarmsVar.DynProperties("MathInfo[0].SourceVars[0].Title") = newVeryLowVar
newVeryLowAlarmsVar.CreateDynProperty ("MathInfo[0].SourceVars")
newVeryLowAlarmsVar.DynProperties("MathInfo[0].SourceVars[1].Title") = newDisableVar
'define type of formular (6208 = Statistik)
newVeryLowAlarmsVar.DynProperties("MathInfo[0].Type") = 6208
'insert formular
newVeryLowAlarmsVar.DynProperties("MathInfo[0].Formula") = "X02 AND NOT(X01)"

newVeryLowAlarmsVar.EdLimitItem(0).Text = "VERY LOW LEVEL OFF"
newVeryLowAlarmsVar.EdLimitItem(0).Cel = True
newVeryLowAlarmsVar.EdLimitItem(0).DynProperties("GroupName") = m_obDriver.Identification
newVeryLowAlarmsVar.EdLimitItem(0).DynProperties("Color") = 65280 '00FF00 Verde

newVeryLowAlarmsVar.EdLimitItem(1).Alarm = True
newVeryLowAlarmsVar.EdLimitItem(1).Text = "VERY LOW LEVEL ON"
newVeryLowAlarmsVar.EdLimitItem(1).Cel = True
newVeryLowAlarmsVar.EdLimitItem(1).DynProperties("GroupName") = m_obDriver.Identification
newVeryLowAlarmsVar.EdLimitItem(1).DynProperties("Color") = 255 'FF0000 Rosso
newVeryLowAlarmsVar.EdLimitItem(1).Blinking = True

'add Source Variable (i.e. Boolean from Internal driver - has to exist already)
newInvalidVar.CreateDynProperty ("MathInfo[0].SourceVars")
newInvalidVar.DynProperties("MathInfo[0].SourceVars[" & invIdx & "].Title") = newVeryLowVar
invIdx = invIdx + 1
End If

If ckbLow.value = True Then
Set newLowVar = MyWorkspace.Application.Projects.Item(cbProjects.Text).Variables.CreateVar(varName & "_Low", varDriver, varChannelType, varDataType)
newLowVar.Tagname = varName
Dim lowAlarmName As String
lowAlarmName = varName & "_Low_Alarm"
MyWorkspace.Application.Projects.Item(cbProjects.Text).Variables.DeleteVar (lowAlarmName)
Set newLowAlarmsVar = MyWorkspace.Application.Projects.Item(cbProjects.Text).Variables.CreateVar(lowAlarmName, mathDriver, nChannelType, varDataType)
newLowAlarmsVar.Tagname = varName
newLowAlarmsVar.DynProperties("AreaName") = cbAlarmArea.Text

'add Source Variable (i.e. Boolean from Internal driver - has to exist already)
newLowAlarmsVar.CreateDynProperty ("MathInfo[0].SourceVars")
newLowAlarmsVar.DynProperties("MathInfo[0].SourceVars[0].Title") = newLowVar
newLowAlarmsVar.CreateDynProperty ("MathInfo[0].SourceVars")
newLowAlarmsVar.DynProperties("MathInfo[0].SourceVars[1].Title") = newDisableVar
'define type of formular (6208 = Statistik)
newLowAlarmsVar.DynProperties("MathInfo[0].Type") = 6208
'insert formular
newLowAlarmsVar.DynProperties("MathInfo[0].Formula") = "X02 AND NOT(X01)"

newLowAlarmsVar.EdLimitItem(0).Text = "LOW LEVEL OFF"
newLowAlarmsVar.EdLimitItem(0).Cel = True
newLowAlarmsVar.EdLimitItem(0).DynProperties("GroupName") = m_obDriver.Identification
newLowAlarmsVar.EdLimitItem(0).DynProperties("Color") = 65280 '00FF00 Verde

newLowAlarmsVar.EdLimitItem(1).Alarm = True
newLowAlarmsVar.EdLimitItem(1).Text = "LOW LEVEL ON"
newLowAlarmsVar.EdLimitItem(1).Cel = True
newLowAlarmsVar.EdLimitItem(1).DynProperties("GroupName") = m_obDriver.Identification
newLowAlarmsVar.EdLimitItem(1).DynProperties("Color") = 255 'FF0000 Rosso
newLowAlarmsVar.EdLimitItem(1).Blinking = True

'add Source Variable (i.e. Boolean from Internal driver - has to exist already)
newInvalidVar.CreateDynProperty ("MathInfo[0].SourceVars")
newInvalidVar.DynProperties("MathInfo[0].SourceVars[" & invIdx & "].Title") = newLowVar
invIdx = invIdx + 1
End If

'add Source Variable (i.e. Boolean from Internal driver - has to exist already)
newInvalidVar.CreateDynProperty ("MathInfo[0].SourceVars")
newInvalidVar.DynProperties("MathInfo[0].SourceVars[" & invIdx & "].Title") = newNormalVar
invIdx = invIdx + 1

If ckbHigh.value = True Then
Set newHighVar = MyWorkspace.Application.Projects.Item(cbProjects.Text).Variables.CreateVar(varName & "_High", varDriver, varChannelType, varDataType)
newHighVar.Tagname = varName
Dim highAlarmName As String
highAlarmName = varName & "_High_Alarm"
MyWorkspace.Application.Projects.Item(cbProjects.Text).Variables.DeleteVar (highAlarmName)
Set newHighAlarmsVar = MyWorkspace.Application.Projects.Item(cbProjects.Text).Variables.CreateVar(highAlarmName, mathDriver, nChannelType, varDataType)
newHighAlarmsVar.Tagname = varName
newHighAlarmsVar.DynProperties("AreaName") = cbAlarmArea.Text

'add Source Variable (i.e. Boolean from Internal driver - has to exist already)
newHighAlarmsVar.CreateDynProperty ("MathInfo[0].SourceVars")
newHighAlarmsVar.DynProperties("MathInfo[0].SourceVars[0].Title") = newHighVar
newHighAlarmsVar.CreateDynProperty ("MathInfo[0].SourceVars")
newHighAlarmsVar.DynProperties("MathInfo[0].SourceVars[1].Title") = newDisableVar
'define type of formular (6208 = Statistik)
newHighAlarmsVar.DynProperties("MathInfo[0].Type") = 6208
'insert formular
newHighAlarmsVar.DynProperties("MathInfo[0].Formula") = "X02 AND NOT(X01)"

newHighAlarmsVar.EdLimitItem(0).Text = "HIGH LEVEL OFF"
newHighAlarmsVar.EdLimitItem(0).Cel = True
newHighAlarmsVar.EdLimitItem(0).DynProperties("GroupName") = m_obDriver.Identification
newHighAlarmsVar.EdLimitItem(0).DynProperties("Color") = 65280 '00FF00 Verde

newHighAlarmsVar.EdLimitItem(1).Alarm = True
newHighAlarmsVar.EdLimitItem(1).Text = "HIGH LEVEL ON"
newHighAlarmsVar.EdLimitItem(1).Cel = True
newHighAlarmsVar.EdLimitItem(1).DynProperties("GroupName") = m_obDriver.Identification
newHighAlarmsVar.EdLimitItem(1).DynProperties("Color") = 255 'FF0000 Rosso
newHighAlarmsVar.EdLimitItem(1).Blinking = True

'add Source Variable (i.e. Boolean from Internal driver - has to exist already)
newInvalidVar.CreateDynProperty ("MathInfo[0].SourceVars")
newInvalidVar.DynProperties("MathInfo[0].SourceVars[" & invIdx & "].Title") = newHighVar
invIdx = invIdx + 1
End If

If ckbOverflow.value = True Then
Set newOverflowVar = MyWorkspace.Application.Projects.Item(cbProjects.Text).Variables.CreateVar(varName & "_Overflow", varDriver, varChannelType, varDataType)
newOverflowVar.Tagname = varName
Dim overflowAlarmName As String
overflowAlarmName = varName & "_Overflow_Alarm"
MyWorkspace.Application.Projects.Item(cbProjects.Text).Variables.DeleteVar (overflowAlarmName)
Set newOverflowVar = MyWorkspace.Application.Projects.Item(cbProjects.Text).Variables.CreateVar(overflowAlarmName, mathDriver, nChannelType, varDataType)
newOverflowVar.Tagname = varName
newOverflowVar.DynProperties("AreaName") = cbAlarmArea.Text

'add Source Variable (i.e. Boolean from Internal driver - has to exist already)
newOverflowVar.CreateDynProperty ("MathInfo[0].SourceVars")
newOverflowVar.DynProperties("MathInfo[0].SourceVars[0].Title") = newOverflowVar
newOverflowVar.CreateDynProperty ("MathInfo[0].SourceVars")
newOverflowVar.DynProperties("MathInfo[0].SourceVars[1].Title") = newDisableVar
'define type of formular (6208 = Statistik)
newOverflowVar.DynProperties("MathInfo[0].Type") = 6208
'insert formular
newOverflowVar.DynProperties("MathInfo[0].Formula") = "X02 AND NOT(X01)"

newOverflowVar.EdLimitItem(0).Text = "OVERFLOW LEVEL OFF"
newOverflowVar.EdLimitItem(0).Cel = True
newOverflowVar.EdLimitItem(0).DynProperties("GroupName") = m_obDriver.Identification
newOverflowVar.EdLimitItem(0).DynProperties("Color") = 65280 '00FF00 Verde

newOverflowVar.EdLimitItem(1).Alarm = True
newOverflowVar.EdLimitItem(1).Text = "OVERFLOW LEVEL ON"
newOverflowVar.EdLimitItem(1).Cel = True
newOverflowVar.EdLimitItem(1).DynProperties("GroupName") = m_obDriver.Identification
newOverflowVar.EdLimitItem(1).DynProperties("Color") = 255 'FF0000 Rosso
newOverflowVar.EdLimitItem(1).Blinking = True

'add Source Variable (i.e. Boolean from Internal driver - has to exist already)
newInvalidVar.CreateDynProperty ("MathInfo[0].SourceVars")
newInvalidVar.DynProperties("MathInfo[0].SourceVars[" & invIdx & "].Title") = newOverflowVar
invIdx = invIdx + 1
End If

'define type of formular (6208 = Statistik)
newInvalidVar.DynProperties("MathInfo[0].Type") = 6208
If invIdx = 2 Then
'insert formular
newInvalidVar.DynProperties("MathInfo[0].Formula") = "(X02 AND NOT(X01))"
ElseIf invIdx = 3 Then
'insert formular
newInvalidVar.DynProperties("MathInfo[0].Formula") = "(X02 AND NOT(X01)) OR (X03 AND NOT(X01 AND X02))"
ElseIf invIdx = 4 Then
'insert formular
newInvalidVar.DynProperties("MathInfo[0].Formula") = "(X02 AND NOT(X01)) OR (X03 AND NOT(X01 AND X02)) OR (X04 AND NOT(X03 AND X02 AND X01))"
ElseIf invIdx = 5 Then
'insert formular
newInvalidVar.DynProperties("MathInfo[0].Formula") = "(X02 AND NOT(X01)) OR (X03 AND NOT(X01 AND X02)) OR (X04 AND NOT(X03 AND X02 AND X01)) OR (X05 AND NOT(X04 AND X03 AND X02 AND X01))"
End If

newInvalidVar.EdLimitItem(0).Text = "INVALID OFF"
newInvalidVar.EdLimitItem(0).Cel = True
newInvalidVar.EdLimitItem(0).DynProperties("GroupName") = m_obDriver.Identification
newInvalidVar.EdLimitItem(0).DynProperties("Color") = 65280 '00FF00 Verde

newInvalidVar.EdLimitItem(1).Alarm = True
newInvalidVar.EdLimitItem(1).Text = "INVALID ON"
newInvalidVar.EdLimitItem(1).Cel = True
newInvalidVar.EdLimitItem(1).DynProperties("GroupName") = m_obDriver.Identification
newInvalidVar.EdLimitItem(1).DynProperties("Color") = 255 'FF0000 Rosso
newInvalidVar.EdLimitItem(1).Blinking = True

Set newDisableVar = MyWorkspace.Application.Projects.Item(cbProjects.Text).Variables.CreateVar(disableName, internalDriver, internChannelType, boolVarType)
newDisableVar.DynProperties("Remanenz") = 1
newDisableVar.DynProperties("Initial_value") = 1

Set newSimuVar = MyWorkspace.Application.Projects.Item(cbProjects.Text).Variables.CreateVar(simuName, internalDriver, internChannelType, boolVarType)
Else
If ckbVeryLow.value = True Then
Set newVeryLowVar = MyWorkspace.Application.Projects.Item(cbProjects.Text).Variables.Item(tbVarName.Text & "_VeryLow")
Set newVeryLowAlarmsVar = MyWorkspace.Application.Projects.Item(cbProjects.Text).Variables.Item(tbVarName.Text & "_VeryLow_Alarms")
End If
If ckbLow.value = True Then
Set newLowVar = MyWorkspace.Application.Projects.Item(cbProjects.Text).Variables.Item(tbVarName.Text & "_Low")
Set newLowAlarmsVar = MyWorkspace.Application.Projects.Item(cbProjects.Text).Variables.Item(tbVarName.Text & "_Low_Alarms")
End If
If ckbHigh.value = True Then
Set newHighVar = MyWorkspace.Application.Projects.Item(cbProjects.Text).Variables.Item(tbVarName.Text & "_High")
Set newHighAlarmsVar = MyWorkspace.Application.Projects.Item(cbProjects.Text).Variables.Item(tbVarName.Text & "_High_Alarms")
End If
If ckbOverflow.value = True Then
Set newOverflowVar = MyWorkspace.Application.Projects.Item(cbProjects.Text).Variables.Item(tbVarName.Text & "_Overflow")
Set newOverflowAlarmsVar = MyWorkspace.Application.Projects.Item(cbProjects.Text).Variables.Item(tbVarName.Text & "_Overflow_Alarms")
End If
Set newNormalVar = MyWorkspace.Application.Projects.Item(cbProjects.Text).Variables.Item(tbVarName.Text & "_Normal")

Set newInvalidVar = MyWorkspace.Application.Projects.Item(cbProjects.Text).Variables.Item(tbVarName.Text & "_Invalid")

Set newDisableVar = MyWorkspace.Application.Projects.Item(cbProjects.Text).Variables.Item(tbVarName.Text & "_Enable")

Set newSimuVar = MyWorkspace.Application.Projects.Item(cbProjects.Text).Variables.Item(tbVarName.Text & "_Simulation")
End If

'get all DynProperties of the actual object (DynPicture, Element, ...)
vProps = m_obElem.DynPropertiesEnum("")
For it = 0 To UBound(vProps)
strProp = Split(vProps(it), ",")
If InStr(1, vProps(it), "StatusDisabled") > 0 Then
m_obElem.DynProperties(strProp(0)) = newDisableVar
ElseIf InStr(1, vProps(it), "offline") > 0 Then
m_obElem.DynProperties(strProp(0)) = MyWorkspace.Application.Projects.Item(cbProjects.Text).Variables.Item(m_obDriver.Identification & "_offline")
ElseIf InStr(1, vProps(it), "Empty") > 0 Then
If ckbVeryLow.value = True Then
m_obElem.DynProperties(strProp(0)) = newVeryLowVar
ElseIf ckbLow.value = True Then
m_obElem.DynProperties(strProp(0)) = newLowVar
Else
m_obElem.DynProperties(strProp(0)) = MyWorkspace.Application.Projects.Item(cbProjects.Text).Variables.Item("Invisible")
End If
ElseIf InStr(1, vProps(it), "VeryLow") > 0 Then
If ckbVeryLow.value = True Then
m_obElem.DynProperties(strProp(0)) = newVeryLowVar
Else
m_obElem.DynProperties(strProp(0)) = MyWorkspace.Application.Projects.Item(cbProjects.Text).Variables.Item("Invisible")
End If
ElseIf InStr(1, vProps(it), "Low") > 0 Then
If ckbLow.value = True Then
m_obElem.DynProperties(strProp(0)) = newLowVar
Else
m_obElem.DynProperties(strProp(0)) = MyWorkspace.Application.Projects.Item(cbProjects.Text).Variables.Item("Invisible")
End If
ElseIf InStr(1, vProps(it), "Normal") > 0 Then
m_obElem.DynProperties(strProp(0)) = newNormalVar
ElseIf InStr(1, vProps(it), "High") > 0 Then
If ckbHigh.value = True Then
m_obElem.DynProperties(strProp(0)) = newHighVar
Else
m_obElem.DynProperties(strProp(0)) = MyWorkspace.Application.Projects.Item(cbProjects.Text).Variables.Item("Invisible")
End If
ElseIf InStr(1, vProps(it), "Overflow") > 0 Then
If ckbOverflow.value = True Then
m_obElem.DynProperties(strProp(0)) = newOverflowVar
Else
m_obElem.DynProperties(strProp(0)) = MyWorkspace.Application.Projects.Item(cbProjects.Text).Variables.Item("Invisible")
End If
ElseIf InStr(1, vProps(it), "Label") > 0 Then
Dim splitVarName() As String
splitVarName = Split(varName, "_")
On Error GoTo Error2
m_obElem.DynProperties(strProp(0)) = splitVarName(1)
ElseIf InStr(1, vProps(it), "Invalid") > 0 Then
m_obElem.DynProperties(strProp(0)) = newInvalidVar
ElseIf InStr(1, vProps(it), "Tooltip") > 0 Then
m_obElem.DynProperties(strProp(0)) = varName
End If
Error2:
Next it
m_obElem.DynProperties("SubstituteSource") = "Var*"
m_obElem.DynProperties("SubstituteDestination") = varName & "_"
Me.Hide
Exit Sub
Error:
MsgBox "Error occurs in method pbOk_Click: " + Err.Description + " Source " + Err.Source
End Sub

The variables association with my symbol properties starts at the end of the function:
VBA Code:
'get all DynProperties of the actual object (DynPicture, Element, ...)
vProps = m_obElem.DynPropertiesEnum("")
For it = 0 To UBound(vProps)
strProp = Split(vProps(it), ",")
If InStr(1, vProps(it), "StatusDisabled") > 0 Then
m_obElem.DynProperties(strProp(0)) = newDisableVar
ElseIf InStr(1, vProps(it), "offline") > 0 Then
m_obElem.DynProperties(strProp(0)) = MyWorkspace.Application.Projects.Item(cbProjects.Text).Variables.Item(m_obDriver.Identification & "_offline")
ElseIf InStr(1, vProps(it), "Empty") > 0 Then
If ckbVeryLow.value = True Then
m_obElem.DynProperties(strProp(0)) = newVeryLowVar
ElseIf ckbLow.value = True Then
m_obElem.DynProperties(strProp(0)) = newLowVar
Else
m_obElem.DynProperties(strProp(0)) = MyWorkspace.Application.Projects.Item(cbProjects.Text).Variables.Item("Invisible")
End If
ElseIf InStr(1, vProps(it), "VeryLow") > 0 Then
If ckbVeryLow.value = True Then
m_obElem.DynProperties(strProp(0)) = newVeryLowVar
Else
m_obElem.DynProperties(strProp(0)) = MyWorkspace.Application.Projects.Item(cbProjects.Text).Variables.Item("Invisible")
End If
ElseIf InStr(1, vProps(it), "Low") > 0 Then
If ckbLow.value = True Then
m_obElem.DynProperties(strProp(0)) = newLowVar
Else
m_obElem.DynProperties(strProp(0)) = MyWorkspace.Application.Projects.Item(cbProjects.Text).Variables.Item("Invisible")
End If
ElseIf InStr(1, vProps(it), "Normal") > 0 Then
m_obElem.DynProperties(strProp(0)) = newNormalVar
ElseIf InStr(1, vProps(it), "High") > 0 Then
If ckbHigh.value = True Then
m_obElem.DynProperties(strProp(0)) = newHighVar
Else
m_obElem.DynProperties(strProp(0)) = MyWorkspace.Application.Projects.Item(cbProjects.Text).Variables.Item("Invisible")
End If
ElseIf InStr(1, vProps(it), "Overflow") > 0 Then
If ckbOverflow.value = True Then
m_obElem.DynProperties(strProp(0)) = newOverflowVar
Else
m_obElem.DynProperties(strProp(0)) = MyWorkspace.Application.Projects.Item(cbProjects.Text).Variables.Item("Invisible")
End If
ElseIf InStr(1, vProps(it), "Label") > 0 Then
Dim splitVarName() As String
splitVarName = Split(varName, "_")
On Error GoTo Error2
m_obElem.DynProperties(strProp(0)) = splitVarName(1)
ElseIf InStr(1, vProps(it), "Invalid") > 0 Then
m_obElem.DynProperties(strProp(0)) = newInvalidVar
ElseIf InStr(1, vProps(it), "Tooltip") > 0 Then
m_obElem.DynProperties(strProp(0)) = varName
End If
Error2:
Next it

WherecbProject.Text is the field in my wizard window where I choose the project where variables are created.
Where is the problem?

This is a migrated post! Originally posted on 27.06.2012 by user davide.galigani. Please be aware that information can be outdated.

    Disclaimer

    This document governs the use of our Community Forum. By registering and using the platform, you accept these conditions.

    The COPA-DATA Community Forum serves to encourage the exchange of information and experience about the zenon software between forum users respectively zenon users.

    Please mind that any published information on the Community Forum is the subjective opinion and view based on the experience and the level of knowledge of the author. COPA-DATA does not overtake any responsibility for the content and the accuracy of the shared information.

    Users of the Community Forum are encouraged to share only well-founded experiences and to point out any risks associated with the implementation of proposed solutions to problems. COPA-DATA at its absolute discretion, reserves the right to moderate the forum. In this connection COPA-DATA may remove any information containing false facts, potentially dangerous solutions, bad language or content that may insult, degrade or discriminate others. COPA-DATA may block a non-complying user from forum access if the user violated this provision.

    COPA-DATA reserves the right to change this document from time to time at own discretion.


    Ing. Punzenberger COPA-DATA GmbH
    Karolingerstraße 7b · 5020 Salzburg · Austria
    www.copadata.com