欢迎来到皮皮网官网

【网站源码网html】【nginx http转发源码】【淘宝商品搜索工具源码】vb mshflexgrid 源码

时间:2024-12-23 08:18:42 来源:来客源码下载

1.VB中如何调用EXCEL中的数据然后在VB中计算在VB中输出结果,能否提供一段源代码

vb mshflexgrid 源码

VB中如何调用EXCEL中的网站源码网html数据然后在VB中计算在VB中输出结果,能否提供一段源代码

       下面的nginx http转发源码程序段是从我设计的程序中复制出来的,你参考参考吧。淘宝商品搜索工具源码实际使用时还需要挑选修改。嵌入式 队列 源码

        '读取工作表的好看的html页面源码内容

       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 = ""

copyright © 2016 powered by 皮皮网   sitemap