国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開APP
userphoto
未登錄

開通VIP,暢享免費(fèi)電子書等14項(xiàng)超值服

開通VIP
VB.NET EXCEL操作

?'文件打開窗口操作
Public CommonDialog1Open As System.Windows.Forms.OpenFileDialog
Dim intErrNum As Short
CommonDialog1Open.FileName = ""
CommonDialog1Save.FileName = ""
CommonDialog1Open.Filter = "EXCEL | *.xls"
CommonDialog1Save.Filter = "EXCEL | *.xls"
CommonDialog1Save.OverwritePrompt = True
CommonDialog1Open.ShowDialog()
CommonDialog1Save.FileName = CommonDialog1Open.FileName

intErrNum = Err.Number
If intErrNum <> Windows.Forms.DialogResult.Cancel Then
'或者寫成下面的方式
'If OpenDialog.ShowDialog() = DialogResult.OK Then

   System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor
   txtExcelName.Text = CommonDialog1Open.FileName
   System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default
End If

?
?'Excel操作,可能參照中要增加excel類
Dim oExcel As Object
Dim oBook As Object
Dim oSheet As New Object
Dim WSheetCount As Integer
oExcel = CreateObject("Excel.Application")
oBook = oExcel.Workbooks.Open(txtExcelName.Text, ReadOnly:=True)
WSheetCount = oExcel.ActiveWorkbook.sheets.count
For i = 1 To WSheetCount
    ’對Sheet1進(jìn)行操作
    If oBook.Worksheets.Item(i).name() = “Sheet1”Then
        oSheet = oExcel.ActiveWorkbook.Sheets(WSheet)
        Exit For
   End If
Next
’通過行列號對單元格進(jìn)行操作
oSheet.Cells(intRow, intColumn).Value

oExcel.Application.DisplayAlerts = False
oExcel.Application.Quit()
oSheet = Nothing
oBook = Nothing
oExcel = Nothing

本站僅提供存儲服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點(diǎn)擊舉報(bào)。
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
將數(shù)據(jù)從VisualBasic傳輸?shù)紼xcel的方法
探討通過VB向EXCEL傳輸數(shù)據(jù)的方法--
excel 導(dǎo)入導(dǎo)出 vb.net版,網(wǎng)上很難找的哦
將DataTable 導(dǎo)出到Excel
立即釋放.net下的com組件
vbs實(shí)現(xiàn)鼠標(biāo)點(diǎn)擊
更多類似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長圖 關(guān)注 下載文章
綁定賬號成功
后續(xù)可登錄賬號暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服