pythonjavaasposeaspose-cellsjpype

No matching overloads found for *static* com.aspose.cells


I have this code in python running jpype and asposeCells libraries, the purpose of this code is to convert numbers in text format (cells with green arrow) into actual numeric value

import jpype
import asposecells
jpype.statJVM()
from asposecells.api import Workbook, Cells

workbook = Workbook(Filepath)
workbook.getWorksheets().get(0)
Cells.convertStringToNumericValue()
workbook.save(Filepath)

jpype.shutdownJVM()

And I encountered this error:

No matching overloads found for *static* com.aspose.cells.Cells.convertStringToNumericValue(), options are public void com.aspose.cells.Cells.convertStringToNumericValue()

Traceback (most recent call last): File "<string>", line 8, in <module> TypeError: No matching overloads found for *static* com.aspose.cells.Cells.convertStringToNumericValue(), options are public void com.aspose.cells.Cells.convertStringToNumericValue()

Appreciate your assistance in resolving this issue, thanks!

The code is use to convert numbers that are in text format into actual number values, server environment is in Linux so I can't use win32 module, so aspose is my only known option to use, but I'm not expert in converting codes from Java to Python.


Solution

  • Your code is wrong. Please note, Cells class is not static, the method convertStringToNumericValue is not static method. Please try the following sample code:

    e.g.

    Sample code:

    import jpype
    import asposecells
    jpype.startJVM()
    from asposecells.api import Workbook, Cells
    
    workbook = Workbook()
    cells = workbook.getWorksheets().get(0).getCells()
    cells.convertStringToNumericValue()
    
    jpype.shutdownJVM()
    

    Moreover, we recommend you to kindly try latest version/fix (Aspose.Cells for Python via Java v22.12) of the API.

    Should you have further queries, you may also post your queries in other forum.

    PS. I am working as Support developer/ Evangelist at Aspose.