调用excel程序,进行操作完后该如何释放掉内存?
关闭这个excel进程?
Option Explicit
Dim e As Excel.Application
Private Sub Command1_Click()
Set e = New Excel.Application
e.Visible = True
Dim i As Long
For i = 1 To 1000000
Next
e.Quit
Set e = Nothing
End Sub
vb没有像java的垃圾收集器,所以要显式的设置为nothing