|
-
Mar 26th, 2003, 01:37 PM
#1
Thread Starter
New Member
Excel Object not getting released
Hi all,
I have crated a VB app that copies data from Access Database to an existing Excel Sheet. It does every fine except that
when I destroy the Excel Object "set Oxl = nothing", it never releases it from the memory. I could see the Excel Process running in the background even after the procedure is finished executing. I have looked several places and can't find anything.
Any help is appreciated.
Thanks
public sub ImportData()
Dim oXl As Excel.Application
Dim oWB As Excel.Workbook
Dim oSheet As Excel.Worksheet
Set oXl = CreateObject("Excel.Application")
Set oWB = oXl.Workbooks.Open(txtPath.Text)
For Each oSheet In Worksheets
oSheet.Activate
oSheet.Range("B17").Value = "Blah"
Loop
oWB.Save
oWB.Saved = True
oXl.Workbooks.Close
oXl.Quit
Set oWB = Nothing
Set oXl = Nothing
end sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|