With Excel 2010 VBA, I am successfully using PISDK.Server.point.Data.RecordedValues to return a PIValues collection for a digital state tag. In my 'for each piVal in PiValues' loop, I can retrieve the .Name value as Str = piVal.Value. But I want to get the numeric Code# of the digital state tag as well. Tech Support found some VB.Net code that uses the following: int = DirectCast(pival.Value, DigitalState).Code Str = DirectCast(pival.Value, DigitalState).Name However, VBA does not have a DirectCast function, or any equivalent I can find that can get the .Code integer value. Any thoughts?