Forum Discussion

JackSparrow's avatar
JackSparrow
Frequent Contributor
9 years ago

python run-time error "method is not callable"

Hi All my aim is  to get the data from  the excel and execute the method which given in the excel but am facing the Python Run-time Error method cannot be callable for the lines 4 and 6   def ReadD...
  • HKosova's avatar
    9 years ago

    Worksheets and Cells are collections, and in Python you need to use .Item[] to access the collection items. So change

    book.Worksheets("TestCases")
    TCSheet.cells(i,1)

    to

    book.Worksheets.Item["TestCases"]
    TCSheet.cells.Item[i,1]

    Also check the documentation for Python specifics in TestComplete.