from ironxl import * # Create new Excel WorkBook document workbook = WorkBook.Create() # Convert XLSX to XLS xlsWorkBook = WorkBook.Create(ExcelFileFormat.XLS) # Create a blank WorkSheet worksheet = workbook.CreateWorkSheet("new_sheet") # Add data and styles to the new worksheet worksheet["A1"].Value = "Hello World" worksheet["A1"].Style.WrapText = True worksheet["A2"].BoolValue = True worksheet["A2"].Style.BottomBorder.Type = BorderType.Double # Save the excel file as XLS, XLSX, CSV, TSV, JSON, XML, HTML and streams workbook.SaveAs("test.xlsx")
建立新的 Excel 文件