473,804 Members | 3,211 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Article Q317109(office app. does not quit...), still problem???

al
Greetings,

I used article Q317109
(http://support.microsoft.com/default...;EN-US;Q317109) to
solve the problem of Excel prcocess does not stop after close. The
problem I faced with the solution provided is that between the export
of data to Excel and destryoing of Excel's objects (calling NAR sub),
I need to provide a prompt to the user to save file to a location, as
per user's choice. However, If the user elects CANCEL option (in case
the file already existt), this will still leave the process runing and
gives a message "exception from HResult:0x800A0 3EC"?????

Any Idea why is that or any alternative solution will be greatly
apprciated!!

'This is the code I used to export to Excel. Please Add DG to fill
with data.

Private Sub btnexport_Click (ByVal sender As System.Object, ByVal e
As System.EventArg s) Handles btnexport.Click
Dim ex As Excel.Applicati on
ex = New Excel.Applicati on

Dim bs As Excel.Workbooks = ex.Workbooks
Dim b As Excel.Workbook = bs.Add
Dim s As Excel.Worksheet = ex.ActiveSheet
ex.Visible = True
s.Visible = Excel.XlSheetVi sibility.xlShee tVisible
Try

'Nex, I will export what is in the dataset to Excel. I did one item
for tesing

s.Range("A1").V alue = DataSet11.Table s(0).Rows(1).It em(2)

'Here I need to prompt the user for saving or use Next code for
implicit saving.

ex.SaveWorkspac e() 'if file already exists and user elect to
cancel, then, a proplem(describ ed at the begning)

Catch err As Exception
MsgBox(err.Mess age)
Finally
nar(s)
b.Close(False)
nar(b)
nar(bs)
ex.Quit()
nar(ex)
GC.Collect()
End Try
End Sub

Sub nar(ByVal o)
Try
System.Runtime. InteropServices .Marshal.Releas eComObject(o)
Catch
Finally
o = Nothing
End Try
End Sub

MTIA,
Grawsha
Nov 20 '05 #1
5 1781
If you are using Office 2003. There are new development tools ( new project
types in VS ) available to control your office applications. Have a look on
the microsoft site.

Regards - OHM
al wrote:
Greetings,

I used article Q317109
(http://support.microsoft.com/default...;EN-US;Q317109) to
solve the problem of Excel prcocess does not stop after close. The
problem I faced with the solution provided is that between the export
of data to Excel and destryoing of Excel's objects (calling NAR sub),
I need to provide a prompt to the user to save file to a location, as
per user's choice. However, If the user elects CANCEL option (in case
the file already existt), this will still leave the process runing and
gives a message "exception from HResult:0x800A0 3EC"?????

Any Idea why is that or any alternative solution will be greatly
apprciated!!

'This is the code I used to export to Excel. Please Add DG to fill
with data.

Private Sub btnexport_Click (ByVal sender As System.Object, ByVal e
As System.EventArg s) Handles btnexport.Click
Dim ex As Excel.Applicati on
ex = New Excel.Applicati on

Dim bs As Excel.Workbooks = ex.Workbooks
Dim b As Excel.Workbook = bs.Add
Dim s As Excel.Worksheet = ex.ActiveSheet
ex.Visible = True
s.Visible = Excel.XlSheetVi sibility.xlShee tVisible
Try

'Nex, I will export what is in the dataset to Excel. I did one item
for tesing

s.Range("A1").V alue = DataSet11.Table s(0).Rows(1).It em(2)

'Here I need to prompt the user for saving or use Next code for
implicit saving.

ex.SaveWorkspac e() 'if file already exists and user elect to
cancel, then, a proplem(describ ed at the begning)

Catch err As Exception
MsgBox(err.Mess age)
Finally
nar(s)
b.Close(False)
nar(b)
nar(bs)
ex.Quit()
nar(ex)
GC.Collect()
End Try
End Sub

Sub nar(ByVal o)
Try
System.Runtime. InteropServices .Marshal.Releas eComObject(o)
Catch
Finally
o = Nothing
End Try
End Sub

MTIA,
Grawsha


--
Best Regards - OHM

O_H_M{at}BTInte rnet{dot}com
Nov 20 '05 #2
> I used article Q317109
(http://support.microsoft.com/default...;EN-US;Q317109) to
solve the problem of Excel prcocess does not stop after close.
http://www.kjmsolutions.com/datasetarray.htm see if the ending funciton
helps you.

Do let me know if it does. This is a post I want to keep.

"al" <gr*********@ya hoo.com> wrote in message
news:66******** *************** ***@posting.goo gle.com... Greetings,
The problem I faced with the solution provided is that between the export
of data to Excel and destryoing of Excel's objects (calling NAR sub),
I need to provide a prompt to the user to save file to a location, as
per user's choice. However, If the user elects CANCEL option (in case
the file already existt), this will still leave the process runing and
gives a message "exception from HResult:0x800A0 3EC"?????

Any Idea why is that or any alternative solution will be greatly
apprciated!!

'This is the code I used to export to Excel. Please Add DG to fill
with data.

Private Sub btnexport_Click (ByVal sender As System.Object, ByVal e
As System.EventArg s) Handles btnexport.Click
Dim ex As Excel.Applicati on
ex = New Excel.Applicati on

Dim bs As Excel.Workbooks = ex.Workbooks
Dim b As Excel.Workbook = bs.Add
Dim s As Excel.Worksheet = ex.ActiveSheet
ex.Visible = True
s.Visible = Excel.XlSheetVi sibility.xlShee tVisible
Try

'Nex, I will export what is in the dataset to Excel. I did one item
for tesing

s.Range("A1").V alue = DataSet11.Table s(0).Rows(1).It em(2)

'Here I need to prompt the user for saving or use Next code for
implicit saving.

ex.SaveWorkspac e() 'if file already exists and user elect to
cancel, then, a proplem(describ ed at the begning)

Catch err As Exception
MsgBox(err.Mess age)
Finally
nar(s)
b.Close(False)
nar(b)
nar(bs)
ex.Quit()
nar(ex)
GC.Collect()
End Try
End Sub

Sub nar(ByVal o)
Try
System.Runtime. InteropServices .Marshal.Releas eComObject(o)
Catch
Finally
o = Nothing
End Try
End Sub

MTIA,
Grawsha

Nov 20 '05 #3

You need some sort of catalogue on your site. What are you going to use ?.
Is you web site hosted using anything special ?

Regards - OHM
scorpion53061 wrote:
I used article Q317109
(http://support.microsoft.com/default...;EN-US;Q317109) to
solve the problem of Excel prcocess does not stop after close.


http://www.kjmsolutions.com/datasetarray.htm see if the ending
funciton helps you.

Do let me know if it does. This is a post I want to keep.

"al" <gr*********@ya hoo.com> wrote in message
news:66******** *************** ***@posting.goo gle.com...
Greetings,

The
problem I faced with the solution provided is that between the export
of data to Excel and destryoing of Excel's objects (calling NAR sub),
I need to provide a prompt to the user to save file to a location, as
per user's choice. However, If the user elects CANCEL option (in
case the file already existt), this will still leave the process
runing and gives a message "exception from HResult:0x800A0 3EC"?????

Any Idea why is that or any alternative solution will be greatly
apprciated!!

'This is the code I used to export to Excel. Please Add DG to fill
with data.

Private Sub btnexport_Click (ByVal sender As System.Object, ByVal e
As System.EventArg s) Handles btnexport.Click
Dim ex As Excel.Applicati on
ex = New Excel.Applicati on

Dim bs As Excel.Workbooks = ex.Workbooks
Dim b As Excel.Workbook = bs.Add
Dim s As Excel.Worksheet = ex.ActiveSheet
ex.Visible = True
s.Visible = Excel.XlSheetVi sibility.xlShee tVisible
Try

'Nex, I will export what is in the dataset to Excel. I did one item
for tesing

s.Range("A1").V alue = DataSet11.Table s(0).Rows(1).It em(2)

'Here I need to prompt the user for saving or use Next code for
implicit saving.

ex.SaveWorkspac e() 'if file already exists and user elect
to cancel, then, a proplem(describ ed at the begning)

Catch err As Exception
MsgBox(err.Mess age)
Finally
nar(s)
b.Close(False)
nar(b)
nar(bs)
ex.Quit()
nar(ex)
GC.Collect()
End Try
End Sub

Sub nar(ByVal o)
Try

System.Runtime. InteropServices .Marshal.Releas eComObject(o)
Catch Finally
o = Nothing
End Try
End Sub

MTIA,
Grawsha


--
Best Regards - OHM

O_H_M{at}BTInte rnet{dot}com
Nov 20 '05 #4
I will be the first ot admit I need help with that end of it. I am not that
good at these kinds of things.

Will you email me off list?

kj***********@c harter.net

remove the no spam part.

"One Handed Man [ OHM# ]" <O_H_M{at}BTInt ernet{dot}com> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..

You need some sort of catalogue on your site. What are you going to use ?.
Is you web site hosted using anything special ?

Regards - OHM
scorpion53061 wrote:
I used article Q317109
(http://support.microsoft.com/default...;EN-US;Q317109) to
solve the problem of Excel prcocess does not stop after close.


http://www.kjmsolutions.com/datasetarray.htm see if the ending
funciton helps you.

Do let me know if it does. This is a post I want to keep.

"al" <gr*********@ya hoo.com> wrote in message
news:66******** *************** ***@posting.goo gle.com...
Greetings,

The
problem I faced with the solution provided is that between the export
of data to Excel and destryoing of Excel's objects (calling NAR sub),
I need to provide a prompt to the user to save file to a location, as
per user's choice. However, If the user elects CANCEL option (in
case the file already existt), this will still leave the process
runing and gives a message "exception from HResult:0x800A0 3EC"?????

Any Idea why is that or any alternative solution will be greatly
apprciated!!

'This is the code I used to export to Excel. Please Add DG to fill
with data.

Private Sub btnexport_Click (ByVal sender As System.Object, ByVal e
As System.EventArg s) Handles btnexport.Click
Dim ex As Excel.Applicati on
ex = New Excel.Applicati on

Dim bs As Excel.Workbooks = ex.Workbooks
Dim b As Excel.Workbook = bs.Add
Dim s As Excel.Worksheet = ex.ActiveSheet
ex.Visible = True
s.Visible = Excel.XlSheetVi sibility.xlShee tVisible
Try

'Nex, I will export what is in the dataset to Excel. I did one item
for tesing

s.Range("A1").V alue = DataSet11.Table s(0).Rows(1).It em(2)

'Here I need to prompt the user for saving or use Next code for
implicit saving.

ex.SaveWorkspac e() 'if file already exists and user elect
to cancel, then, a proplem(describ ed at the begning)

Catch err As Exception
MsgBox(err.Mess age)
Finally
nar(s)
b.Close(False)
nar(b)
nar(bs)
ex.Quit()
nar(ex)
GC.Collect()
End Try
End Sub

Sub nar(ByVal o)
Try

System.Runtime. InteropServices .Marshal.Releas eComObject(o)
Catch Finally
o = Nothing
End Try
End Sub

MTIA,
Grawsha


--
Best Regards - OHM

O_H_M{at}BTInte rnet{dot}com

Nov 20 '05 #5
No, I think you misunderstand. I was not trying to be derisory, I'm simply
interested in this as I am going to do it for my own site at some point.

I was thinking of using Microsoft Sharepoint.
Regards - OHM

scorpion53061 wrote:
I will be the first ot admit I need help with that end of it. I am
not that good at these kinds of things.

Will you email me off list?

kj***********@c harter.net

remove the no spam part.

"One Handed Man [ OHM# ]" <O_H_M{at}BTInt ernet{dot}com> wrote in
message news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..

You need some sort of catalogue on your site. What are you going to
use ?. Is you web site hosted using anything special ?

Regards - OHM
scorpion53061 wrote:
I used article Q317109
(http://support.microsoft.com/default...;EN-US;Q317109)
to solve the problem of Excel prcocess does not stop after close.

http://www.kjmsolutions.com/datasetarray.htm see if the ending
funciton helps you.

Do let me know if it does. This is a post I want to keep.

"al" <gr*********@ya hoo.com> wrote in message
news:66******** *************** ***@posting.goo gle.com...
Greetings,

The
problem I faced with the solution provided is that between the
export of data to Excel and destryoing of Excel's objects (calling
NAR sub), I need to provide a prompt to the user to save file to a
location, as per user's choice. However, If the user elects
CANCEL option (in case the file already existt), this will still
leave the process runing and gives a message "exception from
HResult:0x800A0 3EC"?????

Any Idea why is that or any alternative solution will be greatly
apprciated!!

'This is the code I used to export to Excel. Please Add DG to fill
with data.

Private Sub btnexport_Click (ByVal sender As System.Object,
ByVal e As System.EventArg s) Handles btnexport.Click
Dim ex As Excel.Applicati on
ex = New Excel.Applicati on

Dim bs As Excel.Workbooks = ex.Workbooks
Dim b As Excel.Workbook = bs.Add
Dim s As Excel.Worksheet = ex.ActiveSheet
ex.Visible = True
s.Visible = Excel.XlSheetVi sibility.xlShee tVisible
Try

'Nex, I will export what is in the dataset to Excel. I did one item
for tesing

s.Range("A1").V alue =
DataSet11.Table s(0).Rows(1).It em(2)

'Here I need to prompt the user for saving or use Next code for
implicit saving.

ex.SaveWorkspac e() 'if file already exists and user elect
to cancel, then, a proplem(describ ed at the begning)

Catch err As Exception
MsgBox(err.Mess age)
Finally
nar(s)
b.Close(False)
nar(b)
nar(bs)
ex.Quit()
nar(ex)
GC.Collect()
End Try
End Sub

Sub nar(ByVal o)
Try

System.Runtime. InteropServices .Marshal.Releas eComObject(o)
Catch Finally
o = Nothing
End Try
End Sub

MTIA,
Grawsha


--
Best Regards - OHM

O_H_M{at}BTInte rnet{dot}com


--
Best Regards - OHM

O_H_M{at}BTInte rnet{dot}com
Nov 20 '05 #6

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

Similar topics

3
4514
by: Stephen Brooker | last post by:
Hi all, Just playing around a MS how-to sample to work with an Excel file from within C#. Everything is fine and I understand it OK, however when Excel and the application are closed, there is still an Excel process showing up in the task manager. Every time the app is run, another process shows up for Excel and always stays there. The only way to get rid of it is to kill it manually. So my question is, what is the correct way of...
8
25986
by: ChrisBowringGG | last post by:
When you use Application.Quit() on an Excel application, there can still be an instance of Excel running, as seen in Task Manager. You can try following the advice on MSDN: http://support.microsoft.com/kb/Q317109 but this didn't solve the problem for me.
9
2012
by: J.Marsch | last post by:
I must be missing something here: The Init event for controls does not seem to fire. What I did: Drop a textbox on a blank webform, hook the textbox's Init event. Code: this.Textbox1.Value = "Hello World"; The textbox comes up blank, and if I set a breakpoint on that line of code, I find that it never fires. What am I doing wrong here?
8
1990
by: Will Chamberlain | last post by:
I came across a rather interesting article this morning and thought I'd share. We all know that Visual Studio is a great IDE, but I think we can all agree that it is adds a dramatic change to how we write code. I'm not posting to talk trash or start a flamewar, just wanting feedback in regards to the following article. I happen to use Visual Studio on a daily basis and am not a John Rivers alter-ego. ...
2
1747
by: Howard Kaikow | last post by:
MSFT KB article 302896 includes a step by step example demonstrating how to build an Office COM in VB .NET, Yesterday, I implemented the example and it works correctly when starting each of the following Office 2003 apps from the quick launch bar: Access, Excel, Outlook, Powerpoint and Word. I used VB.NET 2003. Today, I tried to open an extant Word document. I tried two docs, one had already existed, the other was just created anew on...
2
1199
by: Buddy | last post by:
Hello, Microsoft states in there article KB831150 that for error highlighted in bold for 'View State error message after you apply this hotfix' that the status is set to 'Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section. The problem is that the article does not state how to resolve the problem. I am getting the exact problem.
2
2531
by: ChrisFrohlich | last post by:
I have been trying to use the Office PIA's to write an ASP.NEt page to: 1. Open a template workbook 2. Populate some data 3. Save the file back to the server 4. Quit Excel and free up Memory I have been able to do all of the above steps except #4. Each time Excel.exe persists in memory. I have already referred to Q317109 "Office application does not quit after automation from Visual Studio .NET client" without much luck.
3
4060
by: James | last post by:
Howdy. I'm having difficulty getting winword.exe processes to die on our development server when using SET objWord = CreateObject("word.application") from an .ASP page. This problem exists on our development server only as we are still using Office 2000 components in production. No probs in production with the current code which has been in use for a couple of years now.
0
1794
by: Mark Itzcovitz | last post by:
Hi, Some time ago I read an article about replacing Activator.CreateInstance with some code that generated the IL for method calls at run-time using Reflection.Emit. I think the article was in MSDN Magazine, but I may be wrong. I can't now find the article - does anyone else know what article I might be thinking of? If so, can you point me in the right direction? Thanks,
0
9707
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9585
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10586
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10338
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10323
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9161
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7622
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6856
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
3823
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.