Dim ExcelApp As Excel.Application
Dim ExcelBook As Excel.Workbook
Dim ExcelSheet As Excel.Worksheet
Set ExcelApp = CreateObject("excel.application") '创建EXCEL句柄
Set ExcelBook = ExcelApp.Workbooks.Add '创建EXCEL工作薄
Set ExcelSheet = ExcelBook.Worksheets(1) '创建EXCEL工作表
ExcelSheet.Cells(1, 1).Value = "编号"
ExcelSheet.Cells(1, 2).Value = "单位名称"
ExcelSheet.Cells(1, 3).Value = "负责人"
ExcelSheet.Cells(1, 4).Value = "单位地址"
ExcelSheet.Cells(1, 5).Value = "类别"
ExcelSheet.Cells(1, 6).Value = "许可项目"
ExcelSheet.Cells(1, 7).Value = "区域"
ExcelSheet.Cells(1, 8).Value = "乡镇"
ExcelSheet.Cells(1, 9).Value = "发证日期"
ExcelSheet.Cells(1, 10).Value = "截止日期"
ExcelSheet.Range("A2").CopyFromRecordset rs
''''''不知道上述代码有哪些错误,帮我看看。
然后怎么把数据显示在EXCEL?????或怎么把这些记录保存到一个EXCEL文件中。