dim oexcel as new excel.application dim obook as excel.workbook dim osheet as excel.worksheet dim dataarray(2000, 2000) as integer obook = oexcel.workbooks.open("c:/1.xls") osheet = obook.worksheets(1) osheet.name = "ok" dim myadapter as new oledb.oledbdataadapter("select * from list", module1.dbconn) dim mydataset as new dataset myadapter.fill(mydataset, "list") datagrid1.datasource = mydataset.tables("list") dim i as integer dim icount as integer icount = mydataset.tables("list").rows.count for i = 0 to icount - 1 dataarray(i, 0) = datagrid1.item(i, 0) next osheet.range("b1").resize(100, 1).value = dataarray obook.save() oexcel.quit()