Dim app_excel As Excel.Application
Dim book_excel As Excel.Workbook
Set app_excel = New Excel.Application '申请一个Excel.Application内存空间
Set book_excel = app_excel.Workbooks.Open("d:/net/vba/test.xls") '打开EXCEL文件,然后把值返回赋给Workbook类型 book_excel
book_excel.Sheets("sheet1").Cells(2, 2) = "hello world"
book_excel.SaveAs ("d:/net/vba/aaaa.xls") '另存为aaaaa.xls
book_excel.Close 0 '关闭test.xls,0为不保存修改,1为保存修改后的内容
新建一个EXCEL文件
Dim app_excel As Excel.Application
Dim book_excel As Excel.Workbook
Set app_excel = New Excel.Application '申请一个Excel.Application内存空间
'''''''''''''''''''新建一个EXCEL 文件''''''''''''''''''''''''''''''
Set book_excel = app_excel.Wor