Get file variable while Checkout file is not working

HI,

I already created this thread before. Apologies  to recreate again.

I need to get variable while checkout file. And prompt in the message box.

(Refer the codes below)

Select Case poCmd.meCmdType

            Case EdmCmdType.EdmCmd_PreUnlock

                Dim AffectedFile As EdmCmdData

                For Each AffectedFile In ppoData

                    MsgBox("About to Check in")

                    Dim myVault As IEdmVault12 = CType(poCmd.mpoVault, IEdmVault12)

                    Dim myFile As IEdmFile5 = myVault.GetFileFromPath(AffectedFile.mbsStrData1)

                    Dim myVars As IEdmEnumeratorVariable10

                    myVars = CType(myFile.GetEnumeratorVariable(), IEdmEnumeratorVariable10)

                    Dim Rev_Result As String = ""

                    myVars.GetVar("Rev_Old", "", Rev_Result)

                    MsgBox(Rev_Result)

                    myVars.CloseFile(False)

                Next

Getvar is working fine with card button function. While check out I just got empty string.

Could you please anyone help with this?

Thanks

SolidworksApi/macros