Hey folks,

Thanks to everyone for the thoughts on this thread back in April.  I've run
into another hiccup on this Excel automation project. 

I've got a couple of workbooks that throw a "Call was rejected by Callee"
error and I've pinned the error down to the line marked below.

     appExcel.Workbooks.Open(xlDoc, ovUpdate, EmptyParam, EmptyParam,
EmptyParam, 
                             EmptyParam, EmptyParam, EmptyParam, EmptyParam,
EmptyParam, 
                             EmptyParam, EmptyParam, EmptyParam, EmptyParam,
EmptyParam, 0);

-->  excelWBook.ConnectTo(appExcel.ActiveWorkbook);


SOMETIMES immediately after opening a workbook, the call to ConnectTo()
throws this error.  What I have been able to do is reproduce the error under
the debugger.  If I set a breakpoint on the ConnectTo() line and AS SOON as
the breakpoint catches hit RUN again to let it continue, I'll see the error.
But if I pause just 3-5 seconds before letting it continue, it continues
without problem.  

So, it feels like Excel isn't done it's Open() processing before my code
jumps to the ConnectTo() call.  Should I be catching a return value?  Should
I be checking a status flag for Excel?  I'm not an automation expert so I'm
not sure what I'm doing wrong?

Any ideas?  TIA,

------------------------------------------------------------------------
 Jim Burns, <mailto:[EMAIL PROTECTED]>
   Technology Dynamics
   Pearland, Texas  USA 
   281 485-0410 / 281 813-6939


__________________________________________________
Delphi-Talk mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi-talk

Reply via email to