Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Problem with process Excel

Hi

I have very strange problem with excel process. (C#, Win 2k, Office 2002)
I can open application process:
m_objExcel = new Application();

Later i'm working with this, write some data from sql2000 to cells and try
to close excel. Everything seems to be ok but process doesn't end. What's
interesting if i have for exeample small quantity of data (single table)
process end. But if i have more tables - it doesn't. Are there any timeouts
or any tricks to do it?

m_objBook.SaveAs(filePath, m_objOpt, m_objOpt, m_objOpt, m_objOpt, m_objOpt,
XlSaveAsAccessMode.xlNoChange, m_objOpt, m_objOpt, m_objOpt, m_objOpt,
m_objOpt);

m_objBook.Close(false, m_objOpt, m_objOpt);

m_objExcel.Quit();

System.Runtime.InteropServices.Marshal.ReleaseComO bject(m_objSheets);

System.Runtime.InteropServices.Marshal.ReleaseComO bject(m_objBook);

System.Runtime.InteropServices.Marshal.ReleaseComO bject(m_objBooks);

System.Runtime.InteropServices.Marshal.ReleaseComO bject(m_objExcel);

//Clean-up

m_objFont=null;

m_objRange = null;

m_objSheet = null;

m_objSheets = null;

m_objBooks = null;

m_objBook = null;

m_objExcel = null;

GC.Collect();

GC.WaitForPendingFinalizers();



thanks in advance

P.






  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 391
Default Problem with process Excel

you need to be sure that all all references to the excel
app have been properly terminated
eg is WS is a worksheet object that had been set to a
sheet, then
SET WS = NOTHING
and so on

Patrick Molloy
Microsoft Excel MVP


-----Original Message-----
Hi

I have very strange problem with excel process. (C#, Win

2k, Office 2002)
I can open application process:
m_objExcel = new Application();

Later i'm working with this, write some data from

sql2000 to cells and try
to close excel. Everything seems to be ok but process

doesn't end. What's
interesting if i have for exeample small quantity of

data (single table)
process end. But if i have more tables - it doesn't.

Are there any timeouts
or any tricks to do it?

m_objBook.SaveAs(filePath, m_objOpt, m_objOpt, m_objOpt,

m_objOpt, m_objOpt,
XlSaveAsAccessMode.xlNoChange, m_objOpt, m_objOpt,

m_objOpt, m_objOpt,
m_objOpt);

m_objBook.Close(false, m_objOpt, m_objOpt);

m_objExcel.Quit();

System.Runtime.InteropServices.Marshal.ReleaseCom Object

(m_objSheets);

System.Runtime.InteropServices.Marshal.ReleaseCom Object

(m_objBook);

System.Runtime.InteropServices.Marshal.ReleaseCom Object

(m_objBooks);

System.Runtime.InteropServices.Marshal.ReleaseCom Object

(m_objExcel);

//Clean-up

m_objFont=null;

m_objRange = null;

m_objSheet = null;

m_objSheets = null;

m_objBooks = null;

m_objBook = null;

m_objExcel = null;

GC.Collect();

GC.WaitForPendingFinalizers();



thanks in advance

P.






.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Problem with process Excel

ok, i have done it
problem was very strange
when i moved my function to new class created specially for generating
report everything works fine :)

"Patrick Molloy" wrote in message
...
you need to be sure that all all references to the excel
app have been properly terminated
eg is WS is a worksheet object that had been set to a
sheet, then
SET WS = NOTHING
and so on

Patrick Molloy
Microsoft Excel MVP


-----Original Message-----
Hi

I have very strange problem with excel process. (C#, Win

2k, Office 2002)
I can open application process:
m_objExcel = new Application();

Later i'm working with this, write some data from

sql2000 to cells and try
to close excel. Everything seems to be ok but process

doesn't end. What's
interesting if i have for exeample small quantity of

data (single table)
process end. But if i have more tables - it doesn't.

Are there any timeouts
or any tricks to do it?

m_objBook.SaveAs(filePath, m_objOpt, m_objOpt, m_objOpt,

m_objOpt, m_objOpt,
XlSaveAsAccessMode.xlNoChange, m_objOpt, m_objOpt,

m_objOpt, m_objOpt,
m_objOpt);

m_objBook.Close(false, m_objOpt, m_objOpt);

m_objExcel.Quit();

System.Runtime.InteropServices.Marshal.ReleaseCom Object

(m_objSheets);

System.Runtime.InteropServices.Marshal.ReleaseCom Object

(m_objBook);

System.Runtime.InteropServices.Marshal.ReleaseCom Object

(m_objBooks);

System.Runtime.InteropServices.Marshal.ReleaseCom Object

(m_objExcel);

//Clean-up

m_objFont=null;

m_objRange = null;

m_objSheet = null;

m_objSheets = null;

m_objBooks = null;

m_objBook = null;

m_objExcel = null;

GC.Collect();

GC.WaitForPendingFinalizers();



thanks in advance

P.






.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Problem with process Excel

hi,

I am also using the same kind of application and getting the sam
problem, Excel.exe is remaning in the task manager, if i run th
application for 10 times, 10 excel.exe 's r staying in the tas
manager, how to remove them from task manager, because it is slowin
down the performance of my web server.

thanks

Alet

--
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
Using excel to process QIF file John Keith Excel Discussion (Misc queries) 0 November 14th 09 07:15 AM
What process is performed behind excel? Eric Excel Discussion (Misc queries) 2 October 29th 07 05:56 AM
How do I make a process map in Excel? The Hard Worker Charts and Charting in Excel 2 May 24th 05 05:38 PM
How to Quit an Excel process? Joe Brown Excel Programming 0 October 1st 03 06:06 AM
to kill a excel process han keat Excel Programming 1 July 18th 03 07:32 AM


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