After Applying KB arrticle Still Excel won't quit.

C

Claudio Benghi

Hello World,

I've found a problem regarding Interop on Excel 2000.

Here's KB article where the problem should be discussed:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;317109

After Applying KB arrticle Still Excel won't quit after subroutine if.

oSheet.Copy(oSheet, )

function is executed.

If I omit the above line from the code everything works fine... any
ideas?
I've read that OXPPIAs have been tested under framework 1.0 and I'm
actually using visual studio 2003 but I cant' revert my project to
2002...

Reproducting behaviour code follows...

Thanks,
Claudio
------------------------------------
Dim oExcel As Object
Dim oBook As Object
Dim oWbs As Object
Dim oWb As Object
Dim oSheets As Object
Dim oSheet As Object

oExcel = CreateObject("Excel.Application")
oExcel.visible = True
System.Threading.Thread.CurrentThread.Sleep(3000)
oWbs = oExcel.Workbooks
oWb =
oWbs.Open("C:\Bonghi\Ddm\LagDuf\JSR\jsr_dot_net\LD_JSR\Reports\store\1.xls")
oSheets = oWb.sheets
oSheet = oSheets(1)
oSheet.Copy(oSheet, ) ' <--- This line causes Excel task not to quit
oWb.Save()

' NAR sub Taken from KB Article
'
NAR(oSheet)
NAR(oSheets)
NAR(oWb)
NAR(oWbs)
oExcel.quit()
NAR(oExcel)


GC.Collect()
 
B

Bernie Yaeger

Hi Claudio,

Include the following:
objwb.Close()

objxl.DisplayAlerts = True

Marshal.ReleaseComObject(objws) ' this is the excel.worksheet object

objxl.Quit()

Marshal.ReleaseComObject(objxl) ' this is the excel.application object

HTH,

Bernie Yaeger
 
H

Herfried K. Wagner [MVP]

* "Bernie Yaeger said:
Include the following:
objwb.Close()

objxl.DisplayAlerts = True

Marshal.ReleaseComObject(objws) ' this is the excel.worksheet object

objxl.Quit()

Marshal.ReleaseComObject(objxl) ' this is the excel.application object

Isn't that what 'NAR' does?
 
H

Herfried K. Wagner [MVP]

* Claudio Benghi said:
I've found a problem regarding Interop on Excel 2000.

Here's KB article where the problem should be discussed:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;317109

After Applying KB arrticle Still Excel won't quit after subroutine if.

oSheet.Copy(oSheet, )

function is executed.

If I omit the above line from the code everything works fine... any
ideas?
I've read that OXPPIAs have been tested under framework 1.0 and I'm

Are you talking about Interop on Excel 2000, XP or the PIAs for Office
2003? It seems that you are mixing something up.
 
C

Claudio Benghi

Thanks Bernie...

I've tried but it didnt' fix the problem

I suppose the copy method creates any implicit object I cannot NAR

any other Idea?
 
C

Claudio Benghi

Are you talking about Interop on Excel 2000, XP or the PIAs for Office
2003? It seems that you are mixing something up.

Sorry... I'm using Excel 2000...
I just meant that my pc also has Office XP PIA's installed.

Tomorrow I'll try to compile everything with vbnet 2002 and framweork
1.0

Thanks, Claudio
 

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

Top