1.VB中如何调用EXCEL中的数据然后在VB中计算在VB中输出结果,能否提供一段源代码
VB中如何调用EXCEL中的奶粉溯源码过期数据然后在VB中计算在VB中输出结果,能否提供一段源代码
下面的知识库asp源码知识库asp源码程序段是从我设计的程序中复制出来的,你参考参考吧。易语言源码导入另一个源码实际使用时还需要挑选修改。美妆溯源码和没有溯源码的区别
'读取工作表的复仇流浪者源码50级增反源码内容
Dim xlsAPP As Excel.Application '对EXCEL的引用
Dim ExcelIsRuning As Boolean 'EXCEL是否已经运行
Dim BookPay As Excel.Workbook
Dim SheetPay As Excel.Worksheet
Dim nRow As Long, nCol As Long
Dim xlsFile As String
'检查此文件是否还存在
xlsFile = Dir(txtFile.Text)
If xlsFile = "" Then
OpenExcel = False
lblTiShi.Caption = ""
Exit Function
Else
xlsFile = txtFile.Text
End If
'打开EXCEL程序
On Error Resume Next
If IsOpenning Then
BookPay.Close
Else
Set xlsAPP = GetObject(, "Excel.application")
If Err.Number <> 0 Then
Set xlsAPP = CreateObject("Excel.application")
Err.Clear
ExcelIsRuning = False
Else
ExcelIsRuning = True
End If
xlsAPP.DisplayAlerts = False '取消保存提示
End If
Set BookPay = xlsAPP.Workbooks.Open(xlsFile) '打开文件
'提取工作表名称
cboSheet.Clear
For nRow = 1 To BookPay.Sheets.Count
cboSheet.AddItem BookPay.Sheets(nRow).Name
Next
cboSheet.ListIndex = 0
For nRow = 1 To BookPay.Sheets.Count
If BookPay.Sheets(nRow).Name = cboSheet.Text Then
Set SheetPay = BookPay.Sheets(nRow)
Exit For
End If
Next
With MSHFlexGrid1
.Cols = SheetPay.UsedRange.Columns.Count + 1
For nCol = 1 To .Cols - 1
.TextMatrix(0, nCol) = nCol
Next
.Rows = SheetPay.UsedRange.Rows.Count + 1
.ColWidth(0) =
For nRow = 1 To SheetPay.UsedRange.Rows.Count
For nCol = 1 To SheetPay.UsedRange.Columns.Count
.TextMatrix(nRow, nCol) = SheetPay.Cells(nRow, nCol).Value
Next
Next
End With
lblTiShi.Caption = ""
辽宁暗访检查47家保健食品诚信经营示范创建单位
网站源码和框架源码分开_网站源码和框架源码分开使用
源码部署和开源源码
移动端网站源码菜单源码_移动端网站源码菜单源码怎么用
以總理稱人質獲釋前不會停火 人道主義車隊在加沙遭襲
移动端网站源码菜单源码_移动端网站源码菜单源码怎么用