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

Not able to close the Excel Appliaction

Hi,

I've opened an Excel application, done something then I closed using
Application.Quit();

But It's not closing the Excel application. I need to kill iy from task
manager.

Please let me know any pointer for this.

Here is the code snippet:
======================================
ApplicationClass app = new ApplicationClass();
Workbook book = null;
Worksheet sheet = null;

book = app.Workbooks.Open(strFileName, bla, bla...);

<DOING SOMETHING>

app.Workbooks.Close();
app.Quit();
app=null;
.................................................. ............
.................................................. ............
================================

Lotsa thanks in advance.

Regards,
Lotus

Jul 22 '05 #1
3 1578
CT
Does it close down correctly if you don't perform any work, i.e. straight
after opening it?

--
Carsten Thomsen
Enterprise Development with VS .NET, UML, AND MSF
http://www.apress.com/book/bookDisplay.html?bID=105
Communities - http://community.integratedsolutions.dk

"CyberLotus" <Cy********@discussions.microsoft.com> wrote in message
news:AE**********************************@microsof t.com...
Hi,

I've opened an Excel application, done something then I closed using
Application.Quit();

But It's not closing the Excel application. I need to kill iy from task
manager.

Please let me know any pointer for this.

Here is the code snippet:
======================================
ApplicationClass app = new ApplicationClass();
Workbook book = null;
Worksheet sheet = null;

book = app.Workbooks.Open(strFileName, bla, bla...);

<DOING SOMETHING>

app.Workbooks.Close();
app.Quit();
app=null;
.................................................. ...........
.................................................. ...........
================================

Lotsa thanks in advance.

Regards,
Lotus

Jul 22 '05 #2
No.

How do I close that?
Please let me know.

Regards,
Lotus

"CT" wrote:
Does it close down correctly if you don't perform any work, i.e. straight
after opening it?

--
Carsten Thomsen
Enterprise Development with VS .NET, UML, AND MSF
http://www.apress.com/book/bookDisplay.html?bID=105
Communities - http://community.integratedsolutions.dk

"CyberLotus" <Cy********@discussions.microsoft.com> wrote in message
news:AE**********************************@microsof t.com...
Hi,

I've opened an Excel application, done something then I closed using
Application.Quit();

But It's not closing the Excel application. I need to kill iy from task
manager.

Please let me know any pointer for this.

Here is the code snippet:
======================================
ApplicationClass app = new ApplicationClass();
Workbook book = null;
Worksheet sheet = null;

book = app.Workbooks.Open(strFileName, bla, bla...);

<DOING SOMETHING>

app.Workbooks.Close();
app.Quit();
app=null;
.................................................. ...........
.................................................. ...........
================================

Lotsa thanks in advance.

Regards,
Lotus


Jul 22 '05 #3
No seeing the entire section of your code, just my guess:

If the code from
ApplicationClass app=...
to
app.Quit()
is within a single subroutine, it may be because of the variable "book" and
"sheet" are still in scope and not being set to null, so that the opened
Workbook and Worksheet objects is not release, hence, the app object can not
be close. If so, try to close opened Workbook and set "book" and "sheet" to
null before call app.Quit().

"CyberLotus" <Cy********@discussions.microsoft.com> wrote in message
news:AE**********************************@microsof t.com...
Hi,

I've opened an Excel application, done something then I closed using
Application.Quit();

But It's not closing the Excel application. I need to kill iy from task
manager.

Please let me know any pointer for this.

Here is the code snippet:
======================================
ApplicationClass app = new ApplicationClass();
Workbook book = null;
Worksheet sheet = null;

book = app.Workbooks.Open(strFileName, bla, bla...);

<DOING SOMETHING>

app.Workbooks.Close();
app.Quit();
app=null;
.................................................. ...........
.................................................. ...........
================================

Lotsa thanks in advance.

Regards,
Lotus

Jul 22 '05 #4

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

Similar topics

3
by: David Berman | last post by:
Hi, I've written an application to do a while bunch of Excel automation. I open a file, scan through all the worksheets, extract data, and then I try to close Excel. However, I can see that I'm...
5
by: Wenke Ji | last post by:
Hi I open a Excel workbook using below API: Set ExcelServer = CreateObject("EXCEL.Application") Set TargetWorkbook = ExcelServer.Workbooks.Open (CurrentBook) Befor the programm exit , I use...
3
by: CyberLotus | last post by:
Hi, I've opened an Excel application, done something then I closed using Application.Quit(); But It's not closing the Excel application. I need to kill iy from task manager. Please let me...
8
by: SteveS | last post by:
I'm attempting to close EXCEL from within my VB.NET application. Using the excel object library to write data to my spreadsheet is working fine but when I try to quit application object it does not...
7
by: SteveS | last post by:
I'm attempting to close EXCEL from within my VB.NET application. Using the excel object library to write data to my spreadsheet is working fine but when I try to quit application object it does not...
1
by: datttanand | last post by:
how to close excel work book in java script?
4
by: Scott | last post by:
I'm trying to get access to open, refresh and then close an excel spreadsheet for me. Below is the code I'm using to open and close Excel, I just can't get it to refresh my data linked back to my...
1
by: popsoftheyear | last post by:
I'm trying to automate some very simple things in excel, but have run into a roadblock (using c++). To detect excel closing, I just monitor the Excel Process using WaitForSingleObject. In order to...
1
by: paul138 | last post by:
both the Red X (top right), as well as right clicking the tab on the bottom and closing, or even by pressing ALT+F4?? I understand that there are a lot of threads on various sites with this...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.