Public Function Lock_And_Unlock_Test(testID As Integer) As Boolean ' Lock and unlock a test ' It is good practice to lock existing entities when you ' change them programmatically. ' ' This is an example of locking. It is not ' related to version control. Dim objTestFactory As TestFactory Dim objTest As Test On Error GoTo FUNC_ERR Lock_And_Unlock_Test = SUCCESS Set objTestFactory = tdc.TestFactory Set objTest = objTestFactory.Item(testID) objTest.LockObject If Not objTest.IsLocked Then Lock_And_Unlock_Test = FAILURE objTest.UnLockObject If objTest.IsLocked Then Lock_And_Unlock_Test = FAILURE Exit Function FUNC_ERR: Lock_And_Unlock_Test = FAILURE End Function