如何用vb.net把excel读入数组再操作,这里的读入用什么

2024-12-14 16:35:26
推荐回答(1个)
回答1:

首先定义
Public xlApp As Excel.Application
Public xlBook As Excel.Workbook Public xlSheet As Excel.Worksheet然后创建对象
xlApp = CreateObject("Excel.Application") '创建EXCEL对象
xlBook = xlApp.Workbooks.Open("文件路径") '打开已经存在的EXCEL工件簿文件
xlSheet = xlBook.Worksheets("sheet1")