现在的位置: 首页 > 综合 > 正文

按键精灵读取excel数据

2013年09月12日 ⁄ 综合 ⁄ 共 473字 ⁄ 字号 评论关闭

 
Plugin lj=File.SelectFile()
VBSCall x1=InputBox("行数")
VBSCall y1=InputBox("列数")
VBSBegin
    Set xlApp = CreateObject("Excel.Application")
    xlApp.visible = false
    Set xlBook = xlApp.Workbooks.open(lj)
    Set xlSheet = xlBook.ActiveSheet
VBSEnd
i=1
j=1
While i<y1+1
    While j<x1+1
        If xlSheet.cells(i,j).value=""
            SayString "空"
        Else
            SayString xlSheet.cells(i,j).value
        EndIf
        j=j+1
    EndWhile
    j=1
    i=i+1
EndWhile

VBSBegin
    xlApp.quit
    Set xlApp=Nothing
VBSEnd

抱歉!评论已关闭.