overclockgirl
New member
- Local time
- Today, 15:28
- Joined
- Jun 6, 2007
- Messages
- 5
I am writing code to open many Excel files, retrieve data, and populate Access tables. However, there is always one instance of Excel still running in my "processes" in task manager (doesn't show up in "applications") -- i just can't get it to close. Any help would be greatly appreciated! Here is some of my code:
Public Sub LaunchExcel(Files() As String, k As Integer)
Dim intk As Integer
Set appExcel = CreateObject("Excel.Application")
appExcel.Visible = False
For intk = 1 To k
strxls = Files(intk)
appExcel.Workbooks.Open strxls, ReadOnly
IDRad 'calls functions that read data, etc.
appExcel.Workbooks.Close strxls
Next intk
appExcel.quit
set appExcel = nothing
End Sub
I have also used the code: appExcel.quit in several places because multiple instances of Excel stayed open if i didn't.
thanks in advance
Public Sub LaunchExcel(Files() As String, k As Integer)
Dim intk As Integer
Set appExcel = CreateObject("Excel.Application")
appExcel.Visible = False
For intk = 1 To k
strxls = Files(intk)
appExcel.Workbooks.Open strxls, ReadOnly
IDRad 'calls functions that read data, etc.
appExcel.Workbooks.Close strxls
Next intk
appExcel.quit
set appExcel = nothing
End Sub
I have also used the code: appExcel.quit in several places because multiple instances of Excel stayed open if i didn't.
thanks in advance