久久国产成人av_抖音国产毛片_a片网站免费观看_A片无码播放手机在线观看,色五月在线观看,亚洲精品m在线观看,女人自慰的免费网址,悠悠在线观看精品视频,一级日本片免费的,亚洲精品久,国产精品成人久久久久久久

分享

VB.NET EXCEL操作

 nxhujiee 2019-01-05

?'文件打開(kāi)窗口操作
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
    ’對(duì)Sheet1進(jìn)行操作
    If oBook.Worksheets.Item(i).name() = “Sheet1”Then
        oSheet = oExcel.ActiveWorkbook.Sheets(WSheet)
        Exit For
   End If
Next
’通過(guò)行列號(hào)對(duì)單元格進(jìn)行操作
oSheet.Cells(intRow, intColumn).Value

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

    本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,,不代表本站觀點(diǎn),。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式,、誘導(dǎo)購(gòu)買等信息,,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,,請(qǐng)點(diǎn)擊一鍵舉報(bào),。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評(píng)論

    發(fā)表

    請(qǐng)遵守用戶 評(píng)論公約

    類似文章 更多