Housekpng w/ Excel

N

nikedog

I realize that xl won't scale; this is only to import
legacy data into sql server.

My problem is that Excel stays resident in memory after
the following code.

I've tried many combinations but everything leaves Excel
(running under the ASPNET user) as a process running

Any advice suggestions, please.


Imports System.Runtime.InteropServices.Marshal


Dim oXL As Excel.Application
Dim oWorkbook As Excel.Workbook
Dim oWorksheet As Excel.Worksheet

oXL = New Excel.Application
oXL.Visible = False
oXL.Workbooks.Open(sFid)
oWorkbook = oXL.ActiveWorkbook

' Process reading xl file only here

oXL.Quit()
ReleaseComObject(oWorksheet)
ReleaseComObject(oWorkbook)
ReleaseComObject(oXL)
oWorksheet = Nothing
oWorkbook = Nothing
oXL = Nothing
System.GC.Collect()
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,705
Latest member
Stefkari24

Latest Threads

Top