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 FileFormat 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:
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET | |
// The path to the documents directory. | |
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | |
// Get the Excel file into stream | |
using (FileStream stream = new FileStream(dataDir + "Excel95_5.0.xls", FileMode.Open)) | |
{ | |
// Instantiate LoadOptions specified by the LoadFormat. | |
LoadOptions loadOptions1 = new LoadOptions(LoadFormat.Excel97To2003); | |
// Create a Workbook object and opening the file from the stream | |
Workbook wbExcel95 = new Workbook(stream, loadOptions1); | |
Console.WriteLine("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.
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET | |
// The path to the documents directory. | |
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | |
// Get the Excel file into stream | |
using (FileStream stream = new FileStream(dataDir + "Book_Excel97_2003.xls", FileMode.Open)) | |
{ | |
// Instantiate LoadOptions specified by the LoadFormat. | |
LoadOptions loadOptions1 = new LoadOptions(LoadFormat.Excel97To2003); | |
// Create a Workbook object and opening the file from the stream | |
Workbook wbExcel97 = new Workbook(stream, loadOptions1); | |
Console.WriteLine("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.
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET | |
// The path to the documents directory. | |
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | |
// Opening Microsoft Excel 2007 Xlsx Files | |
// Instantiate LoadOptions specified by the LoadFormat. | |
LoadOptions loadOptions2 = new LoadOptions(LoadFormat.Xlsx); | |
// Create a Workbook object and opening the file from its path | |
Workbook wbExcel2007 = new Workbook(dataDir + "Book_Excel2007.xlsx", loadOptions2); | |
Console.WriteLine("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:
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET | |
// The path to the documents directory. | |
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | |
// Instantiate LoadOptions | |
LoadOptions loadOptions6 = new LoadOptions(); | |
// Specify the password | |
loadOptions6.Password = "1234"; | |
// Create a Workbook object and opening the file from its path | |
Workbook wbEncrypted = new Workbook(dataDir + "encryptedBook.xls", loadOptions6); | |
Console.WriteLine("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.