Mapping Excel col names (QTP, VBScript)
Posted by Albert Gareev on 2009/05/23
Original date: 5 Dec 2008, 1:23pm
'Assumptions:
'Excel file exists
'Workbook is open (XLBook)
'Sheet exists
Set objUsedRange = XLBook.Worksheets(sSheetIndex).UsedRange()
Set objSheetColNameMap = CreateObject("Scripting.Dictionary")
For Iter = 1 To objUsedRange.Columns.Count
sCellText = objUsedRange.Cells(1,Iter)
If sCellText <> "" Then
objSheetColNameMap.Item(sCellText) = Iter
End If
Next