0
Reply

Excel Loses Connection With My C# Programm ??

RIGHT THEN

RIGHT THEN

May 2 2008 4:10 AM
2.5k

GentleMen

My Programm In C# 2005 is targetting Windows Xp Excel .

i will have to create many workbooks and sheets in them . that is not a problem

when i create one sheet and then Format it programmatically all the cells and their color

as various ranges for different information. i have created five threads which will update

and calculate the value in the ranges when ever a value is changed in any cell in respective ranges

five threads are handling five diferent ranges.problem is every thing seems fine but just then

after about placing five values excel seems to have lost connection with my programm

there is no error reported or anything. i placed breakpoints and tried this and that

but cant figure this thing out.and this has all happened when i introduced threads to it

 

in normal c# programming when we create a thread if it has to update a control on a form

it has to use invoke mechanism does that apply with excel also.

because even without it it seems to work fine. but only for some time and then my application

and excel become two diffrent applications not communicating with each other

What might be the problem. Are there some logical slolution someone can suggest

or should i paste my code here

but what code should i paste when i myself dont know where the problem is

i have captured all the events of workbook app and sheet in my application

and their functions that handle them are without any code in them does that have any effect

Like in windows programming in c++ when we capture an event in WNDPROc we are supposed to use defwindowproc if it is not attempted and return 0 if it is. Because while debbuging i saw

that control goes to SelectionChange event proc and then after that it disappers

i have that proc empty because as the application grow i might use it. SomeTimes it dissaperas from someother evenproc .

What is going on it is very dippressing

Immidiate help required

 

Thankyou

RIGHT_THEN