Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default help !!! please... closing excel application using automation

Hi
I am writing an application using VB.NET and office 2003.
I write some data into the Excel sheet using automation
and then close it but, I can still see the excel.exe
running in the task manager. .Please 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 a lot..
Vishal

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default help !!! please... closing excel application using automation

Vishal,

You should call your object something other than "Excel"
Call it oExcel instead.

Let me know if that helps?

Rob


wrote in message
...
Hi
I am writing an application using VB.NET and office 2003.
I write some data into the Excel sheet using automation
and then close it but, I can still see the excel.exe
running in the task manager. .Please 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 a lot..
Vishal



  #3   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default help !!! please... closing excel application using automation

Hi Rob

I tried that, but it did not helped...
I do not know what the name of variable has to do with
this problem.


Vishal..

-----Original Message-----
Vishal,

You should call your object something other than "Excel"
Call it oExcel instead.

Let me know if that helps?

Rob


wrote in message
...
Hi
I am writing an application using VB.NET and office

2003.
I write some data into the Excel sheet using automation
and then close it but, I can still see the excel.exe
running in the task manager. .Please 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 a lot..
Vishal



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default help !!! please... closing excel application using automation


Vishal

did you get an answer to the problem ?
I'm experiencing exactly the same problem with my new app.

Any help would be appreciated

PhilEvan
-----------------------------------------------------------------------
Posted via http://www.mcse.m
-----------------------------------------------------------------------
View this thread: http://www.mcse.ms/message248359.htm

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
Closing a workbook exits Excel Application DarS Excel Discussion (Misc queries) 2 September 27th 07 01:51 PM
Excel still running in task manager after closing the application Willem Excel Discussion (Misc queries) 0 December 5th 06 01:56 PM
Automation Testing in an Excel application. HC Excel Discussion (Misc queries) 0 March 30th 05 02:05 AM
More help on closing Excel.Application Snedker[_2_] Excel Programming 4 December 29th 03 01:04 PM
Problem with closing the excel application guhan Excel Programming 1 August 20th 03 01:56 PM


All times are GMT +1. The time now is 05:27 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"