code如下
Dim xlApp As New Excel.Application
Dim xlBooks As Excel.Workbooks = xlApp.Workbooks
Dim xlBook As Excel.Workbook = xlBooks.Open("\\db-machine\db-file\test.xls")
Dim xlSheet As Excel.Worksheet = xlApp.ActiveSheet
DataGridView1.Columns.Add("Test", "Test")
DataGridView1.Item(0, 0).Value = xlSheet.Cells(3, 5).value
沒有留言:
張貼留言