VS 软件太大,我没有安装 ,VB6中是可以的,供参考
Dim objExcel As Excel.Application
Dim objWorkBook As Excel.Workbook
Set objExcel = CreateObject("Excel.Application")
Set objWorkBook = objExcel.Workbooks.Add()
objExcel.Visible = False
Dim objSheet As Excel.Worksheet
Set objSheet = objExcel.Worksheets("sheet1")
objSheet.Cells(1,1) = "姓名" '对单元格赋值
objSheet.Cells(1,2) = Date
objSheet.Cells(1,3) = Time
objWorkBook.SaveAs App.Path & "\a.xls" '保存
objWorkBook.Close
objExcel.Quit
Set objSheet = Nothing
Set objWorkBook = Nothing
Set objExcel = Nothing
no
kjsafs