471,349 Members | 1,438 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,349 software developers and data experts.

Can not kill Excel object

The following article discussed how to use the Excel, close and kill it:

http://support.microsoft.com/default...b;en-us;317109

But if you added a oBook.SaveAs(...) to save the workbook in the code, it
never worked for me. We use Excel 2003 and Visual Studio 2003 under Windows
XP. We don't have problem to kill Excel instance under Windows 2000, feels
like it is a new problem come with XP. I have been searching google for days
and tried all kinds of solution, no luch so far. Please help!!! Thanks.
Jul 21 '05 #1
4 3662
Hi,

I looke at the article you reference and I don't see anything that it's
missing, but admittedly I just scanned it.

More importantly, the code below always works for me - on xp machines, no
problem (csvfilename is the full path to a .dbf file - eg,
f:\apps\dbffiles\test.dbf):

Dim xlapp As New Excel.Application

Dim xlbook As Excel.Workbook

Dim csvfilename As String

If ftype = "csv" Then

xlbook.SaveAs(csvfilename, xlCSV) ' csv

Else

xlbook.SaveAs(csvfilename, xlExcel7) ' xls 7

End If

xlapp.DisplayAlerts = False

xlbook.Close()

xlapp.DisplayAlerts = True

xlapp.Quit()

Marshal.ReleaseComObject(xlapp) ' this is necessary to release a com object

xlbook = Nothing

xlapp = Nothing

HTH,

Bernie Yaeger

"A frustrated developer" <A frustrated de*******@discussions.microsoft.com>
wrote in message news:34**********************************@microsof t.com...
The following article discussed how to use the Excel, close and kill it:

http://support.microsoft.com/default...b;en-us;317109

But if you added a oBook.SaveAs(...) to save the workbook in the code, it
never worked for me. We use Excel 2003 and Visual Studio 2003 under
Windows
XP. We don't have problem to kill Excel instance under Windows 2000, feels
like it is a new problem come with XP. I have been searching google for
days
and tried all kinds of solution, no luch so far. Please help!!! Thanks.

Jul 21 '05 #2
A frustrated developer wrote:
The following article discussed how to use the Excel, close and kill it:

http://support.microsoft.com/default...b;en-us;317109

But if you added a oBook.SaveAs(...) to save the workbook in the code, it
never worked for me. We use Excel 2003 and Visual Studio 2003 under Windows
XP. We don't have problem to kill Excel instance under Windows 2000, feels
like it is a new problem come with XP. I have been searching google for days
and tried all kinds of solution, no luch so far. Please help!!! Thanks.


A lot of things can affect this.

Are you trying to save an excel workbook from within
the same workbook? Are you modifying the code in the
workbook using the VBIDE Extensibility model?

Another thing that can affect this is if Excel tries
to pop up a dialog box on the save, such as to confirm
that information may be lost saving in the selected
format. You'll probably have to post again, giving a
-lot- more details, and a working sample of the code.

Do not reply via email; reply to the newsgroup.
Jul 21 '05 #3

"A frustrated developer" <A frustrated de*******@discussions.microsoft.com>
wrote in message news:34**********************************@microsof t.com...
The following article discussed how to use the Excel, close and kill it:

http://support.microsoft.com/default...b;en-us;317109

But if you added a oBook.SaveAs(...) to save the workbook in the code, it
never worked for me. We use Excel 2003 and Visual Studio 2003 under Windows XP. We don't have problem to kill Excel instance under Windows 2000, feels
like it is a new problem come with XP. I have been searching google for days and tried all kinds of solution, no luch so far. Please help!!! Thanks.


Do you have the Google desktop installed? If it's present, it prevents Excel
from shutting down.

/Fredrik
Jul 21 '05 #4
You are super. I do have Google desktop installed on my machine, after I
uninstalled it, it worked like a charm. Thanks for all the replys to help me
out -:)

"Fredrik Wahlgren" wrote:

"A frustrated developer" <A frustrated de*******@discussions.microsoft.com>
wrote in message news:34**********************************@microsof t.com...
The following article discussed how to use the Excel, close and kill it:

http://support.microsoft.com/default...b;en-us;317109

But if you added a oBook.SaveAs(...) to save the workbook in the code, it
never worked for me. We use Excel 2003 and Visual Studio 2003 under

Windows
XP. We don't have problem to kill Excel instance under Windows 2000, feels
like it is a new problem come with XP. I have been searching google for

days
and tried all kinds of solution, no luch so far. Please help!!! Thanks.


Do you have the Google desktop installed? If it's present, it prevents Excel
from shutting down.

/Fredrik

Jul 21 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Joseph | last post: by
5 posts views Thread by Josema | last post: by
1 post views Thread by Michael Tkachev | last post: by
2 posts views Thread by charmis | last post: by
2 posts views Thread by touf | last post: by
4 posts views Thread by A frustrated developer | last post: by
2 posts views Thread by alexia.bee | last post: by
reply views Thread by XIAOLAOHU | last post: by

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.