To run this sample application:
' Set up column headers
Dim xlsheet As Excel.Worksheet
Set xlsheet = ThisWorkbook.Worksheets(1)
With xlsheet
.Cells(5, 1) = "Date"
.Cells(5, 2) = "UserLoginName"
.Cells(5, 3) = "Host"
.Cells(5, 4) = "Event Kind"
.Cells(5, 5) = "Comment"
End With
' Connect to the top-level ClearCase object
Dim CC as New ClearCase.Application
Dim Elem as CCElement
Dim Record as CCHistoryRecord
Dim Records as CCHistoryRecords
Set Elem = CC.Element("<path>")
' Get the history records via the ICCVOBObject interface
Set Records = Elem.HistoryRecords(Nothing)
Dim I As Integer
I = 6
For Each Record In Records
' Left hand side of assignments below are Excel objects;
' Right hand side are CAL objects
With xlsheet
.Cells(I, 1) = Record.Date
.Cells(I, 2) = Record.UserLoginName
.Cells(I, 3) = Record.Host
.Cells(I, 4) = Record.EventKind
.Cells(I, 5) = Record.Comment
End With
I = I + 1
Next
' Format the worksheet
xlsheet.UsedRange.Select
Selection.AutoFormat
xlsheet.Cells(1, 1).Select