• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            S.l.e!ep.¢%

            像打了激速一樣,以四倍的速度運轉(zhuǎn),開心的工作
            簡單、開放、平等的公司文化;尊重個性、自由與個人價值;
            posts - 1098, comments - 335, trackbacks - 0, articles - 1
              C++博客 :: 首頁 :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理

            VBScript讀取 Excel 與 寫入 Excel

            Posted on 2008-10-21 21:41 S.l.e!ep.¢% 閱讀(3441) 評論(0)  編輯 收藏 引用 所屬分類: VBScript
            Function ?GetCellValue(excelSheet,?row,?column,?path)
            ????????
            on ? error ? resume ? next
            ????????
            Set ?Wshshell? = ? CreateObject ( " Wscript.shell " )
            ????????
            Set ?ExcelApp? = ? CreateObject ( " excel.Application " )
            ????????ExcelApp.Visible?
            = ? True
            ????????
            Set ?newBook? = ?ExcelApp.Workbooks.Open(path)
            ????????
            If ??Err? = ? 0 ? Then
            ????????????????
            Set ?excelSheet? = ?ExcelApp.ActiveSheet
            ????????????????GetCellValue?
            = ?excelSheet.Cells(row,?column)
            ????????????????ExcelApp.Quit
            ????????????????Wshshell.Popup?GetCellValue,
            2 , " 獲取的Excel單元格的值為: " , 0 + 64
            ?????????
            Else
            ????????????????Wshshell.Popup?
            " 請確認文件是否已經(jīng)創(chuàng)建 " , 3 , " 文件不存在 " , 0 + 64
            ????????????????ExcelApp.Quit
            ?????????
            End ? If
            End?Function
            Call ?GetCellValue( " excel " , 9 , 9 , " E:/excel.xls " )

            寫入:
            Function ?WExcel(row,col,value,path)
            ????????
            Set ?Wshshell? = ? Createobject ( " Wscript.shell " )
            ????????Err?
            = ? 0
            ????????
            on ? error ? resume ? next
            ????
            Dim ?fso,f
            ????
            Set ?fso? = ? CreateObject ( " Scripting.FileSystemObject " )
            ????
            Set ?f? = ?fso.GetFile(path)
            ???????????
            Set ?ExcelApp? = ? CreateObject ( " Excel.Application " )
            ????????ExcelApp.Visible?
            = ? true
            ????????
            If ??Err? = ? 0 ? Then
            ????????????????
            Set ?newBook? = ?ExcelApp.Workbooks.Open(path)
            ????????????????newBook.Worksheets(
            1 ).Activate
            ????????????????newBook.Worksheets(
            1 ).Cells(row,col).value = value
            ????????????????newBook.Worksheets(
            1 ).Name = " excel "
            ????????????????newBook.Save
            ????????????????ExcelApp.Application.quit
            ????????????????
            set ?newBook? = ? nothing
            ????????????????
            Set ?ExcelApp? = ? nothing
            ?????????
            Elseif ?Err? = ? 53 ? Then
            ????????????????
            Set ?newBook? = ?ExcelApp.Workbooks.Add
            ????????????????newBook.Worksheets(
            1 ).Activate
            ????????????????newBook.Worksheets(
            1 ).Cells(row,col).value = value?????????????????
            ????????????????newBook.Worksheets(
            1 ).Name = " excel "
            ????????????????newBook.SaveAs?path
            ????????????????ExcelApp.Application.quit
            ????????????????
            set ?newBook? = ? nothing
            ????????????????
            Set ?ExcelApp? = ? nothing
            ?????????
            Else
            ????????????????Wshshell.Popup?
            " 發(fā)生未知錯誤 " ,? 5 ,? " 無法繼續(xù) " , 0 + 32 ????????
            ?????????
            End ? If
            End?Function
            Call ?WExcel( 9 , 9 , " liuyi " , " E:/excel.xls " )
            久久午夜福利无码1000合集| 欧美伊香蕉久久综合类网站| 久久综合色之久久综合| 久久人人爽人人爽人人片AV麻豆| 久久人人爽人人爽AV片| 亚洲乱码精品久久久久..| 久久青草国产精品一区| 国产精品久久久久久久午夜片 | 国产精品久久久久AV福利动漫| 99久久精品免费| 亚洲色欲久久久综合网东京热| 久久九九亚洲精品| 中文字幕乱码人妻无码久久| 亚洲午夜久久影院| 国色天香久久久久久久小说| 国产精品成人久久久久久久| 少妇精品久久久一区二区三区| 久久精品国产精品亜洲毛片| 久久综合88熟人妻| 97视频久久久| 久久精品国产亚洲5555| 久久青青草原国产精品免费| 久久久久亚洲AV无码观看| 国产亚洲色婷婷久久99精品91| 久久精品一本到99热免费| 亚洲国产成人久久精品99| 日本精品久久久久中文字幕| 久久久久se色偷偷亚洲精品av| 久久久精品日本一区二区三区| 久久99国产精品久久久| 久久久亚洲欧洲日产国码二区| 日韩欧美亚洲综合久久| 久久精品国产一区二区三区不卡| 嫩草影院久久国产精品| 久久精品夜夜夜夜夜久久| 久久综合香蕉国产蜜臀AV| 精品国产乱码久久久久软件| 久久香综合精品久久伊人| 热久久最新网站获取| 久久久WWW成人| 99久久国产综合精品五月天喷水 |