Using vbscript to read from an excel file and populate a drop down list
Posted on 2008-10-09
I have an excel file that contains a list of names in one row and the distinguished name in another.
I need to read the file and output the names into the drop down box while having the distinguished name be the value for the selection.
The following was my attempt, but was unsuccessful.
strXLpath = "c:\managers.xls"
Set objXL = CreateObject("Excel.Application")
objXL.visible = False
Set objWb = objXL.WorkBooks.Open(strXLpath)
Do Until objWb.EOF
Set objOption = Document.createElement("OPTION")
objOption.Text = objXL.Rows(1).Value
objOption.Value = objXL.Rows(2).Value