ExitBO

nldeshpande
Hi,

x = ExitBO(Sheets("OrderBook").Cells(i, 1),Sheets("OrderBook").Cells(i, 2))

not working.

Getting error of invalid orderid

How to resolve?

I have tried trim() as well but still the same error.

Thanks in advance

Nilesh Deshpande
  • botany02
    botany02 edited January 2017
    @nldeshpande

    Could You Pls post the Entire Code...?
    Try calling the Function by passing the exact OrderId like x = ExitBO("1645555000","165822222")
    If the above works than your code might be creating problem.
  • nldeshpande
    I have written the exact code while stating the problem.

    However, I have now been able to resolve it by using the CStr() function to explicitly convert the OrderID and the ParentOrderID into strings before passing them as parameters.
  • botany02
    botany02 edited January 2017
    @nldeshpande
    That's Great.. You got solutions...

    Your Initial Error was due to the fact that..

    Sheets("OrderBook").Cells(i, 1) returns Object
    So,
    Call Sheets("OrderBook").Cells(i, 1).Value --> which will return exact cell value.
    So no need to use CStr.
  • nldeshpande
    Oh ok. Thanks a lot
This discussion has been closed.