Can't repeat WPF#1 blog examlpe

Can't repeat WPF#1 blog examlpe

V6.51SP5
On the last stage (PassDataDirect VBA function) I give error before use of obElement.WPFProperty.
Public Sub PassDataDirect()
On Error GoTo Exit_Proc
MsgBox thisProject.DynPictures.Item("Screen 0").Elements.Item("WPF").Top
Dim obElement As Element
obElement = thisProject.DynPictures.Item("Screen 0").Elements.Item("WPF")
MsgBox "OK"
obElement.WPFProperty("Chart1", "ValueName") = "var1"
....
Exit_Proc:
End Sub
Program flow jumps into On_Error label when try to pass the obElement=... line.
Line shows Top coordinate in messageBox is passed correctly - so we have no errors with names.
Line shows "OK" messageBox is never reached.

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