473,395 Members | 1,456 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,395 software developers and data experts.

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:0x800A03EC"?????

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.EventArgs) Handles btnexport.Click
Dim ex As Excel.Application
ex = New Excel.Application

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.XlSheetVisibility.xlSheetVisible
Try

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

s.Range("A1").Value = DataSet11.Tables(0).Rows(1).Item(2)

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

ex.SaveWorkspace() 'if file already exists and user elect to
cancel, then, a proplem(described at the begning)

Catch err As Exception
MsgBox(err.Message)
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.ReleaseComO bject(o)
Catch
Finally
o = Nothing
End Try
End Sub

MTIA,
Grawsha
Nov 20 '05 #1
5 1760
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:0x800A03EC"?????

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.EventArgs) Handles btnexport.Click
Dim ex As Excel.Application
ex = New Excel.Application

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.XlSheetVisibility.xlSheetVisible
Try

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

s.Range("A1").Value = DataSet11.Tables(0).Rows(1).Item(2)

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

ex.SaveWorkspace() 'if file already exists and user elect to
cancel, then, a proplem(described at the begning)

Catch err As Exception
MsgBox(err.Message)
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.ReleaseComO bject(o)
Catch
Finally
o = Nothing
End Try
End Sub

MTIA,
Grawsha


--
Best Regards - OHM

O_H_M{at}BTInternet{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*********@yahoo.com> wrote in message
news:66**************************@posting.google.c om... 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:0x800A03EC"?????

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.EventArgs) Handles btnexport.Click
Dim ex As Excel.Application
ex = New Excel.Application

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.XlSheetVisibility.xlSheetVisible
Try

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

s.Range("A1").Value = DataSet11.Tables(0).Rows(1).Item(2)

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

ex.SaveWorkspace() 'if file already exists and user elect to
cancel, then, a proplem(described at the begning)

Catch err As Exception
MsgBox(err.Message)
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.ReleaseComO bject(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*********@yahoo.com> wrote in message
news:66**************************@posting.google.c om...
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:0x800A03EC"?????

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.EventArgs) Handles btnexport.Click
Dim ex As Excel.Application
ex = New Excel.Application

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.XlSheetVisibility.xlSheetVisible
Try

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

s.Range("A1").Value = DataSet11.Tables(0).Rows(1).Item(2)

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

ex.SaveWorkspace() 'if file already exists and user elect
to cancel, then, a proplem(described at the begning)

Catch err As Exception
MsgBox(err.Message)
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.ReleaseComO bject(o)
Catch Finally
o = Nothing
End Try
End Sub

MTIA,
Grawsha


--
Best Regards - OHM

O_H_M{at}BTInternet{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***********@charter.net

remove the no spam part.

"One Handed Man [ OHM# ]" <O_H_M{at}BTInternet{dot}com> wrote in message
news:%2****************@TK2MSFTNGP10.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*********@yahoo.com> wrote in message
news:66**************************@posting.google.c om...
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:0x800A03EC"?????

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.EventArgs) Handles btnexport.Click
Dim ex As Excel.Application
ex = New Excel.Application

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.XlSheetVisibility.xlSheetVisible
Try

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

s.Range("A1").Value = DataSet11.Tables(0).Rows(1).Item(2)

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

ex.SaveWorkspace() 'if file already exists and user elect
to cancel, then, a proplem(described at the begning)

Catch err As Exception
MsgBox(err.Message)
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.ReleaseComO bject(o)
Catch Finally
o = Nothing
End Try
End Sub

MTIA,
Grawsha


--
Best Regards - OHM

O_H_M{at}BTInternet{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***********@charter.net

remove the no spam part.

"One Handed Man [ OHM# ]" <O_H_M{at}BTInternet{dot}com> wrote in
message news:%2****************@TK2MSFTNGP10.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*********@yahoo.com> wrote in message
news:66**************************@posting.google.c om...
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:0x800A03EC"?????

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.EventArgs) Handles btnexport.Click
Dim ex As Excel.Application
ex = New Excel.Application

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.XlSheetVisibility.xlSheetVisible
Try

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

s.Range("A1").Value =
DataSet11.Tables(0).Rows(1).Item(2)

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

ex.SaveWorkspace() 'if file already exists and user elect
to cancel, then, a proplem(described at the begning)

Catch err As Exception
MsgBox(err.Message)
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.ReleaseComO bject(o)
Catch Finally
o = Nothing
End Try
End Sub

MTIA,
Grawsha


--
Best Regards - OHM

O_H_M{at}BTInternet{dot}com


--
Best Regards - OHM

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

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

Similar topics

3
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...
8
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: ...
9
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 =...
8
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...
2
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...
2
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...
2
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...
3
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...
0
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...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
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
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...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.