Open Latest Revision of a Part from TcE

Is there anything wrong in following Method I am trying, I am not getting any output with this. *I am using NX 11.

Dim PartNo As String = "XXXXX"
Dim Parttag As Tag = Nothing
ufs.Ugmgr.AskPartTag(PartNo, Parttag)
Dim RevCount As Integer = Nothing
Dim RevisionsTag() As Tag = Nothing
Dim LatestRevision As String = Nothing

If Parttag <> NXOpen.Tag.Null Then
ufs.Ugmgr.ListPartRevisions(Parttag, RevCount, RevisionsTag)
ufs.Ugmgr.AskPartRevisionId(RevisionsTag(UBound(RevisionsTag)), LatestRevision)
Else
lw.WriteLine(PartNo & ": Unable to Open the Correct Revision of the Part")
End If
MsgBox(LatestRevision)
theSession.Parts.SetNonmasterSeedPartData("@DB/" & PartNo & "/" & LatestRevision)
Dim basePart1 As BasePart = Nothing
Try
Dim partLoadStatus1 As PartLoadStatus = Nothing
basePart1 = theSession.Parts.Open("@DB/" & PartNo, partLoadStatus1)
partLoadStatus1.Dispose()
Dim partLoadStatus2 As PartLoadStatus = Nothing
Dim status1 As PartCollection.SdpsStatus
status1 = theSession.Parts.SetDisplay(basePart1, False, True, partLoadStatus2)
partLoadStatus2.Dispose()
Catch exc As NXException
lw.WriteLine(exc.Message)
End Try

Don't forget to add the part revision information in the call to the .Open method.

basePart1 = theSession.Parts.Open("@DB/" & PartNo & "/" & LatestRevision, partLoadStatus1)

It's working Perfect.

Regards,

Joe