Board index » cppbuilder » Exel Automation : "Cell" Busy being changed

Exel Automation : "Cell" Busy being changed

basically the problem is that Excel is busy and
that is why I am getting the call is rejected by callee.

Anyone know how to wait for the cell object to be freed
and to re-try later?

Quote
rashidw wrote:
> Hi.

> I have got an automation program going.
> This retrieves info from an excel spreadsheet cell

> In my next step, I would like my app. to wait for
> a specific spreadsheet cell to change (i.e. cell A1)

> So, I have implemented my code in a for loop.

> But, when I enter the spreadsheet and try to
> change the value in the cell. The prog. collapses
> with:
> "... exception class EOleSysError with message 'Call was
> rejected by callee'. Process stopped.....

> here's my code snippet:

>    for(;;)
>    {
>    Range.ClearArgs();
>    SetValue.ClearArgs();
>     try
>     {
>       my_range    = my_worksheet.Exec(Range << "A1");
>     }
>     catch(...)
>     {
>     }
>    }

> I would really appreciate some suggestions. regards.

 

Re:Exel Automation : "Cell" Busy being changed


Quote
rashidw wrote:

> basically the problem is that Excel is busy and
> that is why I am getting the call is rejected by callee.

> Anyone know how to wait for the cell object to be freed
> and to re-try later?

Can you do it in a loop which you break when the call succeeds?
.a

Other Threads