Multiple instances of excel process starts

S

shantanu

Dear All

I am facing a problem while automating excel, developing excel addin.
When i execute the excel addin, multiple excel process starts
generating in the task bar and thue my application hangs. Is there any
ways to handle the same.

need a sol asasp.. SOS

thanks
shantanu
 
O

OssieMac

Hi,

Are you using any code like Set Variablename = some object

If so are you then inserting code to Set Variablename = Nothing after you
are finished with it.

This is only suggestion. I don't really know that is the problem.
 
S

shantanu

Hi
thanks a lot for the reply
No i am not using any such code. I have developed an C# addin for
excel in Visual Studios 2008.

object format=5;//Nothing value.
Excel.ApplicationClass xlApp=new Excel.ApplicationClass();
Excel.Workbook xlBook=xlApp.Workbooks.Open(@"F:\Book1.XLS",0, false,
format, null, null, false, Excel.XlPlatform.xlWindows, null,true,
false, 0, true, false, false);
Excel.Sheets xlSheets = xlBook.Worksheets;
Excel.Worksheet xlSheet = (Excel.Worksheet)xlSheets.get_Item
("Sheet1"); // open Sheet1.
xlSheet.Cells[1,2]="1234567"; // lets add a new value.

xlBook.Save();
xlApp.Quit();

now when i run the addin, it creates a menu tab in the ribbon and
along with it starts creating multiple instance of excel in task
manager.

Please advise

regards
Shantanu
 
O

OssieMac

Hi again,

I don't know anything about C# but the following line looks a lot like the
type of code I was referring to and I suspect that is where you are gettin
the extra instances of Excel but again I am not sure so I'll gracefully bow
out now.

Excel.ApplicationClass xlApp=new Excel.ApplicationClass();
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top