欢迎来到福编程网,本站提供各种互联网专业知识!

jscript之Read an Excel Spreadsheet

发布时间:2007-06-13 作者: 来源:转载
DescriptionDemonstrationscriptthatreadsthevaluesstoredinaspreadsheetnamedC:\Scripts\New_users.xls.ScriptCode复制代码代码如下:SetobjExcel=CreateObject("Excel.Application")SetobjWorkbook=objExcel.Workbooks.Open_("C:\Scripts\New_users.x
Description

Demonstrationscriptthatreadsthevaluesstoredinaspreadsheet
namedC:ScriptsNew_users.xls.
ScriptCode
复制代码 代码如下:
SetobjExcel=CreateObject("Excel.Application")
SetobjWorkbook=objExcel.Workbooks.Open_
("C:ScriptsNew_users.xls")

intRow=2

DoUntilobjExcel.Cells(intRow,1).Value=""
Wscript.Echo"CN:"&objExcel.Cells(intRow,1).Value
Wscript.Echo"sAMAccountName:"&objExcel.Cells(intRow,2).Value
Wscript.Echo"GivenName:"&objExcel.Cells(intRow,3).Value
Wscript.Echo"LastName:"&objExcel.Cells(intRow,4).Value
intRow=intRow+1
Loop

objExcel.Quit



相关推荐