IRONSOFTWAREHOME
Create a new Excel File
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")
pip install ironxl
Create a new Excel File

Create a new Excel File

The Create Excel feature in IronXL gives Python developers a straightforward way to generate and manage Excel files programmatically. It simplifies tasks like creating new workbooks, adding worksheets, and populating data while offering advanced styling options such as text wrapping, borders, and cell formatting. This feature is ideal for automating reports, exporting data, or building dynamic spreadsheets. IronXL supports multiple file formats including XLS, XLSX, CSV, and more, ensuring broad compatibility. With its intuitive API, developers can focus on core logic while eliminating the complexity of Excel file management in Python.

The WorkBook object is the foundation of any Excel file in IronXL. Calling WorkBook.Create() initializes a blank workbook, ready to be populated with data and formatted as needed.

Every Excel workbook requires at least one worksheet. The CreateWorkSheet method adds a new sheet to the workbook with a custom name. Worksheets provide the primary structure for organizing data into rows and columns.

Once the worksheet is in place, data can be added by assigning values directly to cell addresses such as worksheet["A1"].Value = "Hello World". This makes it simple to automate tasks like report generation and data export from Python applications.

Styling is applied through the Style property on any cell or range. Enabling WrapText = True ensures that lengthy content displays neatly across multiple lines, improving readability and producing professional-looking spreadsheets.

Finally, SaveAs persists the workbook to disk in the specified format. IronXL supports .xlsx, .xls, .csv, and other formats, giving developers flexibility in how they distribute or integrate their Excel output.

Explore the Step-by-Step Guide to Create Excel Files in Python

Ready to Get Started?

Version:2026.9just released

Key in blue circle

Get your free 30-day Trial Key instantly.

Your trial license will be sent to your email address

No limitations. 100% unlocked. No credit card.

bullet_checkedNo credit card or account creation requiredNo limitations. 100% unlocked. No credit card.
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronPDF
Book your free Live Demo
Booking Badge

Trusted by Millions of Engineers Worldwide

Iron Software's customer logos
Get Your No-Obligation Consult
Complete the form below or email sales@ironsoftware.com
Your details will always be kept confidential.
Trusted by Millions of Engineers Worldwide
Iron Software's customer logos
Get your free 30-day Trial Key instantly.
No credit card or account creation required