html5中文学习网

您的位置: 首页 > 网站及特效实例 > javascript特效 » 正文

jscript之Read an Excel Spreadsheet_javascript技巧_

[ ] 已经帮助:人解决问题
Description

Demonstration script that reads the values stored in a spreadsheet 
named C:/Scripts/New_users.xls. 
Script Code
复制代码 代码如下:

Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open _
    ("C:/Scripts/New_users.xls")

intRow = 2

Do Until objExcel.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



(责任编辑:)
推荐书籍
推荐资讯
关于HTML5先行者 - 联系我们 - 广告服务 - 友情链接 - 网站地图 - 版权声明 - 人才招聘 - 帮助