透過 Python 編輯 Excel 元資料
from ironxl import *

# Load the Excel workbook
workbook = WorkBook.Load("sample.xlsx")

# Set author
workbook.Metadata.Author = "Your Name"
# Set comments
workbook.Metadata.Comments = "Monthly report"
# Set title
workbook.Metadata.Title = "July"
# Set keywords
workbook.Metadata.Keywords = "Report"

# Read the creation date of the Excel file
creation_date = workbook.Metadata.Created

# Read the last printed date of the Excel file
print_date = workbook.Metadata.LastPrinted

# Save the workbook with edited metadata
workbook.SaveAs("editedMetadata.xlsx")
pip install ironxl
透過 Python 編輯 Excel 元資料

透過 Python 編輯 Excel 元資料

使用IronXL for Python以程式方式編輯Excel中繼資料允許開發人員更新工作簿屬性,例如author、title、subject或自定義中繼資料欄位,而無需手動操作。 這在自動化工作流程、大規模數據處理或需要中繼資料驅動解決方案的整合場景中特別有用。

IronXL通過支援流行的Excel格式(包括XLSX、XLS和CSV),使這一過程更高效。此功能最大程度減少了手動工作,並確保了處理報告、審核或中繼資料驅動應用程式的團隊的準確性。 它簡化了Excel文件與後端系統之間的連接,支持在真實世界的Python環境中有效擴展的動態中繼資料更新。

探索如何使用IronXL for Python編輯工作簿中繼資料

準備好開始了嗎?

版本:2026.11剛剛發布