Erron on AlarmClass StatusVar

Erron on AlarmClass StatusVar

I read the thread below
http://www.copadata.com/forums/showthread.php?p=1191&mode=threaded
and I' want to read the StatusVar from an alarmClass item, but I receive an error on the line:
VBA Code:
Debug.Print MyWorkspace.ActiveDocument.DynProperties("AlarmAreas[" & Trim(Str(nAreaCounter)) & ".Items[" & Trim(Str(nAreaItemCounter)) & "].StatusVar")

Runtime Error '438':
The object does not support this property or method
I post the entire code:
VBA Code:
Dim nAreaCounter As Integer
Dim nAreaAmount As Integer
Dim nAreaItemAmount As Integer
Dim nAreaItemCounter As Integer
nAreaAmount = MyWorkspace.Application.Projects.Item("PCA_BOLOGNA").DynProperties("AlarmAreas")

If (nAreaAmount > 0) Then
For nAreaCounter = 0 To nAreaAmount - 1
Debug.Print MyWorkspace.Application.Projects.Item("PCA_BOLOGNA").DynProperties("AlarmAreas[" & Trim(Str(nAreaCounter)) & "].Name")
nAreaItemAmount = MyWorkspace.Application.Projects.Item("PCA_BOLOGNA").DynProperties("AlarmAreas[" & Trim(Str(nAreaCounter)) & "].Items")
If (nAreaItemAmount > 0) Then
For nAreaItemCounter = 0 To nAreaItemAmount - 1
Debug.Print MyWorkspace.Application.Projects.Item("PCA_BOLOGNA").DynProperties("AlarmAreas[" & Trim(Str(nAreaCounter)) & "].Items[" & Trim(Str(nAreaItemCounter)) & "].ClassName")
Debug.Print "AlarmAreas[" & Trim(Str(nAreaCounter)) & "].Items[" & Trim(Str(nAreaItemCounter)) & "].StatusVar"
Debug.Print MyWorkspace.Application.Projects.Item("PCA_BOLOGNA").DynProperties("AlarmAreas[" & Trim(Str(nAreaCounter)) & "].Items[" & Trim(Str(nAreaItemCounter)) & "].StatusVar")
Debug.Print MyWorkspace.Application.Projects.Item("PCA_BOLOGNA").DynProperties("AlarmAreas[" & Trim(Str(nAreaCounter)) & "].Items[" & Trim(Str(nAreaItemCounter)) & "].AlarmVar")
Debug.Print MyWorkspace.Application.Projects.Item("PCA_BOLOGNA").DynProperties("AlarmAreas[" & Trim(Str(nAreaCounter)) & "].Items[" & Trim(Str(nAreaItemCounter)) & "].QuitVar")
Next
End If
Next
End If

Where is the problem?

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