获取创建Excel文档的应用程序的版本号

Contents
[ ]

以下示例代码演示了Workbook.BuiltInDocumentProperties.Version属性的使用。它加载由Microsoft Excel 2003、2007、2010和2013创建的Excel文件,并打印创建这些Excel文档的应用程序的版本号。

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET
// Create a workbook reference
Workbook workbook = null;
// Print the version number of Excel 2003 XLS file
workbook = new Workbook("Excel2003.xls");
Console.WriteLine("Excel 2003 XLS Version: " + workbook.BuiltInDocumentProperties.Version);
// Print the version number of Excel 2007 XLS file
workbook = new Workbook("Excel2007.xls");
Console.WriteLine("Excel 2007 XLS Version: " + workbook.BuiltInDocumentProperties.Version);
// Print the version number of Excel 2010 XLS file
workbook = new Workbook("Excel2010.xls");
Console.WriteLine("Excel 2010 XLS Version: " + workbook.BuiltInDocumentProperties.Version);
// Print the version number of Excel 2013 XLS file
workbook = new Workbook("Excel2013.xls");
Console.WriteLine("Excel 2013 XLS Version: " + workbook.BuiltInDocumentProperties.Version);
// Print the version number of Excel 2007 XLSX file
workbook = new Workbook("Excel2007.xlsx");
Console.WriteLine("Excel 2007 XLSX Version: " + workbook.BuiltInDocumentProperties.Version);
// Print the version number of Excel 2010 XLSX file
workbook = new Workbook("Excel2010.xlsx");
Console.WriteLine("Excel 2010 XLSX Version: " + workbook.BuiltInDocumentProperties.Version);
// Print the version number of Excel 2013 XLSX file
workbook = new Workbook("Excel2013.xlsx");
Console.WriteLine("Excel 2013 XLSX Version: " + workbook.BuiltInDocumentProperties.Version);