【顺丰速运溯源码查询】【影视源码html】【ounion联盟源码】Vb自动接收文件源码_vb自动接收文件源码是什么

时间:2024-12-29 11:05:24 来源:文件分享网站源码 编辑:android 跳棋源码

1.VB 读取Excel的内容

Vb自动接收文件源码_vb自动接收文件源码是自动自动<strong>顺丰速运溯源码查询</strong>什么

VB 读取Excel的内容

       '以下是源代码:

       '引用Microsoft Excel .0 Object Library

       'Excel文件放于D盘目录下,名称为:my.xls

       Private Sub Command1_Click()

       Dim A() As String

       Dim i As Integer

       Dim xlsApp As Excel.Application

       Dim xlsWorkbook As Excel.Workbook

       Dim xlssheet As Excel.Worksheet

        Set xlsApp = CreateObject("Excel.Application")

        Set xlsWorkbook = xlsApp.Workbooks.Open("D:\my.xls")

        xlsApp.Visible = True

        xlsApp.Range("A1").Select

       For i = 1 To

        A(i) = xlsApp.ActiveCell.Offset(0, i - 1).Value

        Print i;

        Print " ";

        Print A(i)

       Next i

       Set xlssheet = Nothing

       Set xlsWorkbook = Nothing

       Set xlsApp = Nothing

       End Sub

copyright © 2016 powered by 皮皮网   sitemap