from ironxl import * # Supported for XLSX, XLS, XLSM, XLTX, CSV, and TSV workbook = WorkBook.Load("sample.xlsx") # Select worksheet at index 0 worksheet = workbook.WorkSheets[0] # Get any existing worksheet first_sheet = workbook.DefaultWorkSheet # Select a cell and return the converted value cell_value = worksheet["A2"].IntValue # Read from ranges of cells elegantly. for cell in worksheet["A2:A10"]: print("Cell {} has value '{}'".format(cell.AddressString, cell.Text)) # Calculate aggregate values such as Min, and Sum total_sum = worksheet["A2:A10"].Sum()
无需使用Interop加载Excel文件