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

A

al

Greetings,

I used article Q317109
(http://support.microsoft.com/default.aspx?scid=kb;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.ReleaseComObject(o)
Catch
Finally
o = Nothing
End Try
End Sub

MTIA,
Grawsha
 
O

One Handed Man [ OHM# ]

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
 
O

One Handed Man [ OHM# ]

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
 
S

scorpion53061

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?

(e-mail address removed)

remove the no spam part.
 
O

One Handed Man [ OHM# ]

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
 

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