Dim VBe As Excel.Application '对象声明
Private Sub Command1_Click()
Set VBe = CreateObject("Excel.Application") '调用Excel
With VBe
.Workbooks.Add '工作薄
With ActiveWorkbook
.SaveAs App.Path + "\aa.XLS" '保存文件
End With
End With
VBe.Visible = True '可见
End Sub
Private Sub Command2_Click()
With VBe
.Quit '关闭工作薄
End With
End Sub