Farklı Microsoft Excel Sürümleri Dosyalarını Açın
Farklı Microsoft Excel Sürümleri Dosyalarını Açma
Bir uygulamanın genellikle farklı sürümlerde oluşturulmuş Microsoft Excel dosyalarını açabilmesi gerekir, örneğin, Microsoft Excel 95,97 veya Microsoft Excel 2007/2010/2013/2016/2019 ve Office 365. Belirli birkaç formattan herhangi birinde dosya yüklemeniz gerekebilir, bunlar arasında XLS, XLSX, XLSM, XLSB, SpreadsheetML, TabDelimited veya TSV, CSV, ODS ve benzerleri bulunur. Formatı belirleyen Workbook sınıfının file_format tip özelliğini veya FileFormatType sıralamasını belirten özellikleri belirtmek için kullanılır.
FileFormatType numaralandırması birçok önceden tanımlanmış dosya biçimini içerir. Bunlardan bazıları aşağıda verilmiştir.
Dosya Biçimi Türleri | Açıklama |
---|---|
Csv | CSV dosyasını temsil eder |
Excel97To2003 | Excel 97 - 2003 dosyasını temsil eder |
Xlsx | Excel 2007/2010/2013/2016/2019 ve Office 365 XLSX dosyasını temsil eder |
Xlsm | Excel 2007/2010/2013/2016/2019 ve Office 365 XLSM dosyasını temsil eder |
Xltx | Excel 2007/2010/2013/2016/2019 ve Office 365 şablonu XLTX dosyasını temsil eder |
Xltm | Excel 2007/2010/2013/2016/2019 ve Office 365 makro etkin XLTM dosyasını temsil eder |
Xlsb | Excel 2007/2010/2013/2016/2019 ve Office 365 binary XLSB dosyasını temsil eder |
SpreadsheetML | SpreadsheetML dosyasını temsil eder |
Tsv | TSV dosyasını temsil eder |
TabDelimited | Tab Delimited metin dosyasını temsil eder |
Ods | ODS dosyasını temsil eder |
Html | HTML dosyasını temsil eder |
Mhtml | MHTML dosyasını temsil eder |
Microsoft Excel 95/5.0 Dosyalarını Aç
Microsoft Excel 95/5.0 dosyasını açmak için, ilgili özniteliği belirlemek için LoadOptions sınıfı için LoadOptions kullanın ve şablon dosyası yüklenecek. Bu özelliği test etmek için bir örnek dosya aşağıdaki bağlantıdan indirilebilir:
from aspose.cells import LoadFormat, LoadOptions, Workbook | |
# For complete examples and data files, please go to https:# github.com/aspose-cells/Aspose.Cells-for-.NET | |
# The path to the documents directory. | |
dataDir = RunExamples.GetDataDir(".") | |
# Get the Excel file into stream | |
with open(dataDir + "Excel95_5.0.xls", "rb") as stream: | |
# Instantiate LoadOptions specified by the LoadFormat. | |
loadOptions1 = LoadOptions(LoadFormat.EXCEL_97_TO_2003) | |
# Create a Workbook object and opening the file from the stream | |
wbExcel95 = Workbook(stream, loadOptions1) | |
print("Microsoft Excel 95/5.0 workbook opened successfully!") |
Microsoft Excel 97 - 2003 Dosyalarını Aç
Microsoft Excel 97 - 2003 dosyasını açmak için LoadOptions kullanın ve ilgili özniteliği belirlemek için LoadOptions sınıfı için LoadOptions kullanın şablon dosyası yüklenecek.
from aspose.cells import LoadFormat, LoadOptions, Workbook | |
# For complete examples and data files, please go to https:# github.com/aspose-cells/Aspose.Cells-for-.NET | |
# The path to the documents directory. | |
dataDir = RunExamples.GetDataDir(".") | |
# Get the Excel file into stream | |
with open(dataDir + "Book_Excel97_2003.xls", "rb") as stream: | |
# Instantiate LoadOptions specified by the LoadFormat. | |
loadOptions1 = LoadOptions(LoadFormat.EXCEL_97_TO_2003) | |
# Create a Workbook object and opening the file from the stream | |
wbExcel97 = Workbook(stream, loadOptions1) | |
print("Microsoft Excel 97 - 2003 workbook opened successfully!") |
Microsoft Excel 2007/2010/2013/2016/2019 ve Office 365 XLSX Dosyalarını Aç
Microsoft Excel 2007/2010/2013/2016/2019 ve Office 365 biçimini yani XLSX veya XLSB dosya yolunu belirtin. Ayrıca, şablon dosyası yüklenecek LoadOptions sınıf için LoadOptions ve ilgili öznitelik/seçeneklerini de kullanabilirsiniz.
from aspose.cells import LoadFormat, LoadOptions, Workbook | |
# For complete examples and data files, please go to https:# github.com/aspose-cells/Aspose.Cells-for-.NET | |
# The path to the documents directory. | |
dataDir = RunExamples.GetDataDir(".") | |
# Opening Microsoft Excel 2007 Xlsx Files | |
# Instantiate LoadOptions specified by the LoadFormat. | |
loadOptions2 = LoadOptions(LoadFormat.XLSX) | |
# Create a Workbook object and opening the file from its path | |
wbExcel2007 = Workbook(dataDir + "Book_Excel2007.xlsx", loadOptions2) | |
print("Microsoft Excel 2007 - Office365 workbook opened successfully!") |
Şifreli Excel Dosyalarını Aç
Microsoft Excel kullanarak şifreli dosyalar oluşturmak mümkündür. Şifreli bir dosyayı açmak için, LoadOptions kullanın ve yüklenen şablon dosyası için öznitelikleri ve seçeneklerini ayarlayın (örneğin, bir parola verin). Bu özelliği test etmek için bir örnek dosya aşağıdaki bağlantıdan indirilebilir:
from aspose.cells import LoadOptions, Workbook | |
# For complete examples and data files, please go to https:# github.com/aspose-cells/Aspose.Cells-for-.NET | |
# The path to the documents directory. | |
dataDir = RunExamples.GetDataDir(".") | |
# Instantiate LoadOptions | |
loadOptions6 = LoadOptions() | |
# Specify the password | |
loadOptions6.password = "1234" | |
# Create a Workbook object and opening the file from its path | |
wbEncrypted = Workbook(dataDir + "encryptedBook.xls", loadOptions6) | |
print("Encrypted excel file opened successfully!") |
Aspose.Cells ayrıca şifre korumalı Microsoft Excel 2007, 2010, 2013, 2016, 2019, Office 365 dosyalarını açmayı destekler.