自动化错误,求助??
Private Sub C1_Click()
Dim objExcel As Excel.Application
Dim objWorkBook As Excel.Workbook
Set objExcel = CreateObject("Excel.Application")
Set objWorkBook = objExcel.Workbooks.Add()
objExcel.Visible = True
'设置活动工作表
Dim objSheet As Excel.Worksheet
Set objSheet = objExcel.Worksheets("sheet1")
objSheet.Cells(1, 1) = "mather" '对单元格赋值
objWorkBook.SaveAs "D:\aa.xls" '保存
objWorkBook.Close
objExcel.Quit
Set objSheet = Nothing
Set objWorkBook = Nothing
Set objExcel = Nothing
End Sub