假设定义的记录名为myres Dim myexcel As New Excel.Application Dim mybook As New Excel.Workbook Dim mysheet As New Excel.Worksheet Set mybook = myexcel.Workbooks.Add '添加一个新的BOOK Set mysheet = mybook.Worksheets.Add '添加一个新的SHEET myexcel.visible=true mysheet.Cells.CopyFromRecordset myres mybook.SaveAs (m_ExcelName) '保存文件
这是我从网上抄的,你可以修改一下用用看,我也不熟,成了发一个上来我参考一下