• <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.¢%

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

            VBScript讀取 Excel 與 寫入 Excel

            Posted on 2008-10-21 21:41 S.l.e!ep.¢% 閱讀(3434) 評論(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?
            " 請確認文件是否已經創建 " , 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?
            " 發生未知錯誤 " ,? 5 ,? " 無法繼續 " , 0 + 32 ????????
            ?????????
            End ? If
            End?Function
            Call ?WExcel( 9 , 9 , " liuyi " , " E:/excel.xls " )
            丰满少妇人妻久久久久久4| 97久久精品人人澡人人爽| 久久精品中文字幕一区| 日韩十八禁一区二区久久| 人妻无码αv中文字幕久久琪琪布 人妻无码精品久久亚瑟影视 | 97久久精品人妻人人搡人人玩| 久久精品国产精品亚洲毛片| 国产精品一区二区久久精品无码| 日本精品久久久久久久久免费| 久久久久免费精品国产| 国产一区二区精品久久凹凸| 久久婷婷五月综合国产尤物app| 国产精品久久影院| 久久人人爽人人人人片av| 久久精品国产免费| 无码专区久久综合久中文字幕 | 久久综合鬼色88久久精品综合自在自线噜噜 | 精品一区二区久久| 性做久久久久久久久浪潮| 久久九九有精品国产23百花影院| 99久久香蕉国产线看观香| 亚洲国产成人久久精品影视| 久久久久成人精品无码中文字幕 | 人人狠狠综合久久88成人| 欧美久久久久久午夜精品| 久久九九亚洲精品| 九九久久自然熟的香蕉图片| 久久久久高潮综合影院| 一97日本道伊人久久综合影院| 国产精品成人久久久久三级午夜电影 | 久久久久九九精品影院| 久久99国产一区二区三区| 999久久久国产精品| 丁香五月综合久久激情| 99久久精品九九亚洲精品| 一级做a爰片久久毛片人呢| AV无码久久久久不卡网站下载| 狠狠色噜噜色狠狠狠综合久久| 亚洲精品NV久久久久久久久久| 伊人久久亚洲综合影院| 久久人人爽人人爽人人片AV不|