Excel process remaining

  • Thread starter Thread starter Rob T
  • Start date Start date
R

Rob T

I have a routine that imports a spreadsheet which normally works fine.
However, sometimes I can find excel.exe is still running as a process in the
task manager and I manually need to end it. If I don't kill it, I'm unable
to open other spread sheets through the regular excel app.

Attached is my code....is there something else I should do to insure the
process ends? Thanks.

strExcel = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & boxFile.Text &
";Extended Properties=""Excel 8.0;IMEX=1;HDR=NO"""

Try

cnnExcel = New OleDbConnection(strExcel)

da = New OleDbDataAdapter("Select * from [ODRJYUFI$]", cnnExcel)

ds = New DataSet

da.Fill(ds, "Excel")

cnnExcel.Close()

dv = New DataView(ds.Tables("Excel"))

Catch ex As Exception

Exit Sub

End Try
 
I suspect you have code somewhere that causes the problem, not the code you
showed here. In the code you posted, there is nothing involve Exece.exe, the
Excel application. The data is read by Jet engine, which does not start
Exce.exe.
 
There are bugs in this provider that can cause worksheets to double in size
unpredictably and without apparent cause. There is a KB article about this,
which you could probably find without much trouble. With that sort of
bugginess, I wouldn;t be trying to use ADO. Automate Excel instead (assuming
you are not running your code unattended on a server without a login).

Norman Yuan said:
I suspect you have code somewhere that causes the problem, not the code you
showed here. In the code you posted, there is nothing involve Exece.exe, the
Excel application. The data is read by Jet engine, which does not start
Exce.exe.

Rob T said:
I have a routine that imports a spreadsheet which normally works fine.
However, sometimes I can find excel.exe is still running as a process in the
task manager and I manually need to end it. If I don't kill it, I'm unable
to open other spread sheets through the regular excel app.

Attached is my code....is there something else I should do to insure the
process ends? Thanks.

strExcel = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & boxFile.Text &
";Extended Properties=""Excel 8.0;IMEX=1;HDR=NO"""

Try

cnnExcel = New OleDbConnection(strExcel)

da = New OleDbDataAdapter("Select * from [ODRJYUFI$]", cnnExcel)

ds = New DataSet

da.Fill(ds, "Excel")

cnnExcel.Close()

dv = New DataView(ds.Tables("Excel"))

Catch ex As Exception

Exit Sub

End Try
 
Remaining Excel Process

Actually I'm having the same problem. I don't know why(yet), but I know how. For the ghost app to show up you have to have the Excel document open in Excel, that you are opening using OLE. If you do anything using OLE on a file that is open in Excel, you can close both Excel and your app, and the process will still appear in Task Manager. Anybody have any ideas?

Dan



Norman Yuan said:
I suspect you have code somewhere that causes the problem, not the code you
showed here. In the code you posted, there is nothing involve Exece.exe, the
Excel application. The data is read by Jet engine, which does not start
Exce.exe.

"Rob T" wrote in message
news:[email protected]...
> I have a routine that imports a spreadsheet which normally works fine.
> However, sometimes I can find excel.exe is still running as a process in

the
> task manager and I manually need to end it. If I don't kill it, I'm

unable
> to open other spread sheets through the regular excel app.
>
> Attached is my code....is there something else I should do to insure the
> process ends? Thanks.
>
> strExcel = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & boxFile.Text

&
> ";Extended Properties=""Excel 8.0;IMEX=1;HDR=NO"""
>
> Try
>
> cnnExcel = New OleDbConnection(strExcel)
>
> da = New OleDbDataAdapter("Select * from [ODRJYUFI$]", cnnExcel)
>
> ds = New DataSet
>
> da.Fill(ds, "Excel")
>
> cnnExcel.Close()
>
> dv = New DataView(ds.Tables("Excel"))
>
> Catch ex As Exception
>
> Exit Sub
>
> End Try
>
>
 
Back
Top