View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
NickHK NickHK is offline
external usenet poster
 
Posts: 4,391
Default start excel in background

It sounds like you are creating references to Excel that are not closed
properly.
When you main form closes these will of course be closed, thus allowing
Excel to close.

Make sure all object are references through your ExcelApp object or its
objects :
Dim ExcelApp as Excel.application
Dim WB As Excel.Workbook
Set ExcelApp=New Excel.Application

Set WB=ExcelApp.Workbooks.Add
With WB.WorkSheets(1)
.Range('A1").Value="Whatever"
'...etc

NickHK

"gladiator" wrote in message
...
I am new to excel programming.
There is a windows form application, one of tasks is to format an

excel
sheet in background first , then print it out. at last shutdown excel
gracelfully without stop the windows form application.
It worked well at first ,but recently we found that excel do not exit
until the main form is shut down.
How to shutdown excel which is run in normal mode but invisible using
C#?Or how control the excel process well in invisible manner?

Thanks