Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default application is not getting closed through automation

Hi

I am using VB.NET and Office 2003. I have written a small
program, which creats an excel application and writes teh
data into the sheet and the closes the application. But
when i go to the task manager, I can still see the
excel.exe running there.
Plese help me:)

The code I am using is :
Dim Excel As New Excel.ApplicationClass
' Get a new workbook
Dim oBook As Excel._Workbook = CType
(Excel.Workbooks.Add(oTemplate), Excel._Workbook)
....
...
oBook.SaveAs("c:\SearchResults.xls")
Excel.ActiveWorkbook.Close(False)

System.Runtime.InteropServices.Marshal.ReleaseComO bject
(oBook) ' releases the workbook object
oBook = Nothing
Excel.Quit()

System.Runtime.InteropServices.Marshal.ReleaseComO bject
(Excel) ' releases the excel object
Excel = Nothing


Thanks Vishal
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default application is not getting closed through automation

Try
Set Excel = Nothing

I wonder if you should be using something like 'MyExcel' instead, there
are often hidden problems with (semi-) reserved words.


---
Message posted from http://www.ExcelForum.com/

  #3   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default application is not getting closed through automation

I am doing that. Pls see the code attached with the
original post.
I am using VB.net so there is no set command. I am still
not able to close the excel.exe even after doing this.

Vishal



-----Original Message-----
Try
Set Excel = Nothing

I wonder if you should be using something like 'MyExcel'

instead, there
are often hidden problems with (semi-) reserved words.


---
Message posted from http://www.ExcelForum.com/

.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
automation Sherees Excel Discussion (Misc queries) 4 December 11th 09 09:59 PM
Automation Allenc Excel Worksheet Functions 5 January 13th 07 10:42 AM
Automation Testing in an Excel application. HC Excel Discussion (Misc queries) 0 March 30th 05 02:05 AM
Automation and Add-Ins Forrest[_3_] Excel Programming 2 December 19th 03 05:45 PM
Automation Frank[_18_] Excel Programming 3 October 29th 03 02:18 AM


All times are GMT +1. The time now is 03:11 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"