By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,677 Members | 1,136 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,677 IT Pros & Developers. It's quick & easy.

After Applying KB arrticle Still Excel won't quit.

P: n/a
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...b;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()

Nov 20 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
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

"Claudio Benghi" <bo******@hotmail.com> wrote in message
news:b6********************************@4ax.com...
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...b;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()

Nov 20 '05 #2

P: n/a
* "Bernie Yaeger" <be*****@cherwellinc.com> scripsit:
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?

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #3

P: n/a
* Claudio Benghi <bo******@hotmail.com> scripsit:
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...b;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.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #4

P: n/a
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?

On Thu, 20 Nov 2003 08:55:26 -0500, "Bernie Yaeger"
<be*****@cherwellinc.com> wrote:
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

"Claudio Benghi" <bo******@hotmail.com> wrote in message
news:b6********************************@4ax.com.. .
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...b;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\L D_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()


Nov 20 '05 #5

P: n/a
On 20 Nov 2003 19:07:43 +0100, hi***************@gmx.at (Herfried K.
Wagner [MVP]) wrote:
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.


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
Nov 20 '05 #6

P: n/a
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?

On Thu, 20 Nov 2003 08:55:26 -0500, "Bernie Yaeger"
<be*****@cherwellinc.com> wrote:
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

"Claudio Benghi" <bo******@hotmail.com> wrote in message
news:b6********************************@4ax.com.. .
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...b;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\L D_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()


Nov 20 '05 #7

P: n/a
On 20 Nov 2003 19:07:43 +0100, hi***************@gmx.at (Herfried K.
Wagner [MVP]) wrote:
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.


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
Nov 20 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.