Read card variable ini EPDM Task Addin - OnTaskRun subroutine

I need to read a card variable in the onTaskRun procedure in a Task Add-in.

In non-task add-ins I've been able to use this to read the revision variable from the data card.

               Dim vars As IEdmEnumeratorVariable8 = poCmd.mpoExtra

               Dim Revision As String = Nothing

               vars.GetVar("Revision", "@", Revision)

I tried this in the task add-in OnTaskRun procedure and the task fails. With only this line added the task will fail:

               Dim vars As IEdmEnumeratorVariable8 = poCmd.mpoExtra

Thanks,

Mike

SolidworksApi macros