Add element to zenOn ListBox

Add element to zenOn ListBox

Hi
I'm trying to add element in a listbox (zenOn object) with VBA during application is in runtime.
The same code, is working in a wizard.
To debug better, I add in the beginning a control on the presence of listbox but execution arrive at the end of the subroutine without error but without result.
Any suggestion?
Thank you

VBA Code:
Set Grid = thisProject.DynPictures.Item("@Device trend browser").Elements.Item("TrendGrid")
If Grid Is Nothing Then
MsgBox "nothing"
Exit sub
End If
With Grid
.CreateDynProperty ("States[" & CStr(Index) & "]")
.CreateDynProperty ("States[" & CStr(Index) & "].Text")
.DynProperties("States[" & CStr(Index) & "].Text") = regLoopName(IndexLoop)
.CreateDynProperty ("States[" & CStr(Index) & "].Value")
.DynProperties("States[" & CStr(Index) & "].Value") = Index
End With


This is a migrated post! Originally posted on 05.11.2012 by user fabios. Please be aware that information can be outdated.