Quantcast
Channel: Excel IT Pro Discussions forum
Viewing all articles
Browse latest Browse all 11829

Facing problem to Checkin and checkout file from starteam using vba

$
0
0

Hi,

Im trying to checkin and checkout file in starteam through vba. I have imported theStarTeamSDK104.dll in reference in vba project and tried to accomplish my task.

I am able to locate the file, but not able to checkout/checkin the file. I am not sure how to use checkin/checkout function in vba. I am getting an error at the checkout code(hichlighted in bold in the below code). Also I was able to do it in java but i want it in vba.

Could someone help me on this.

Below is the code im using.

**************************************************************************************

Sub ST_Test()
  
Dim strAddress As String
Dim nPort As Long
Dim strUser As String
Dim strPassword As String
Dim strProjectName As String
 
strAddress = "Sample Address"
nPort = 1234
strUser = "Sample Username"
strPassword = "Sample Password"
strProjectName = "Sample Project"

Dim Factory As New StServerFactory
Dim Server As StServer

Set Server = Factory.Create(strAddress, nPort)
Server.Connect
Server.logOn strUser, strPassword

Dim project As StProject

Set project = FindProject(Server, strProjectName)

Dim view As StView
Dim finder As StStarTeamFinder
Dim Folder As Stfolder

Set view = project.DefaultView
Set Folder = view.RootFolder
For Each chk In Folder.getItems(Server.TypeNames.File)
    Dim fileitem As StFile
    Set fileitem = chk
    If fileitem.Name = "Filename.txt" Then
        fileitem.checkout(0,False,True,False )
    End If
Next chk

End Sub

*************************************************************************************



Viewing all articles
Browse latest Browse all 11829

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>