473,387 Members | 3,801 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Excel process remaining

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
Nov 21 '05 #1
2 1162
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" <RT*********@DONTwalchemSPAM.com> wrote in message
news:OL**************@TK2MSFTNGP10.phx.gbl...
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

Nov 21 '05 #2
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" wrote:
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" <RT*********@DONTwalchemSPAM.com> wrote in message
news:OL**************@TK2MSFTNGP10.phx.gbl...
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


Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Allison Bailey | last post by:
Hi Folks, I'm a brand new Python programmer, so please point me in the right direction if this is not the best forum for this question.... I would like to open an existing MS Excel spreadsheet...
1
by: smonczka | last post by:
I have a DTS package that needs to refresh data in 3 separate Excel spreadsheets on a daily basis. The problem is that unless I manually delete the previous day's data, it appends rather than...
2
by: Praveen K | last post by:
I have a problem in communicating between the C# and the Excel Interop objects. The problem is something as described below. I use Microsoft Office-XP PIA dll’s as these dll’s were been...
2
by: Powerguy | last post by:
Hi all, I am looking for a way to get the Process id (or a handle) of an EXCEL process created from within my code. For example when the following code is executed: Dim EXL As...
18
by: lgbjr | last post by:
Hi All, I have a VB.NET app that, among other things, writes data to Excel. I am having trouble getting the Excel process to terminate after I quit Excel. I found an article related to this...
1
by: fakehitswizard | last post by:
this is the correct way to close excel with C#. I've seen alot of other bogus posts ALL over the web that don't work, how frustrating. string savepath; bool foundPID; int ourPID = 0; int...
0
by: Tony Hine | last post by:
Problem for Excel Developers One of the problems facing Excel developers moving into MS Access is actually the apparent similarity between MS Access tables and Excel spreadsheets. MS Access is...
7
by: =?Utf-8?B?VGVycnkgSG9sbGFuZA==?= | last post by:
I have a vb.net app that opens an excel worksheet, reads data and then closes the sheet. Im noticing that the Excel process is still running after I have closed and disposed of my excel objects. ...
7
by: Samuel A. Falvo II | last post by:
I have a shell script script.sh that launches a Java process in the background using the &-operator, like so: #!/bin/bash java ... arguments here ... & In my Python code, I want to invoke...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.