Çalışma Sayfasını Koruma ve Kaldırma
Çalışma Sayfalarını Koruma
Bir çalışma sayfası korunduğunda, bir kullanıcının yapabileceği eylemler sınırlıdır. Örneğin, veri girişi yapamaz, satır veya sütun ekleyemez veya silemez vb. Microsoft Excel’de genel koruma seçenekleri:
- İçerik
- Nesneler
- Senaryolar
Korunan çalışma sayfaları hassas verileri gizlemez veya korumaz, bu yüzden dosya şifrelemesinden farklıdır. Genellikle çalışma sayfası koruması sunum amaçları için uygundur. Bu, son kullanıcının çalışma sayfasındaki verileri, içeriği ve biçimlendirmeyi değiştirmesini engeller.
Koruma Ekleme veya Kaldırma
Aspose.Cells, bir Microsoft Excel dosyasını temsil eden Workbook sınıfını sağlar. Workbook sınıfı, bir Excel dosyasındaki her çalışma sayfasına erişmeyi sağlayan bir WorksheetCollection içerir. Bir çalışma sayfası, Worksheet sınıfı tarafından temsil edilir.
Worksheet sınıfı, bir çalışma sayfasına koruma uygulamak için kullanılan Protect metodunu sağlar. Protect metodu aşağıdaki parametreleri kabul eder:
- Koruma Türü, çalışma sayfasına uygulanacak koruma türü. Koruma türü, ProtectionType numaralandırması ile uygulanır.
- Yeni Parola, çalışma sayfasını korumak için kullanılan yeni parola.
- Eski Şifre, çalışma sayfası zaten şifre korumalıysa eski şifre. Eğer çalışma sayfası zaten korumalı değilse, sadece bir null geçin.
ProtectionType numaralandırması aşağıdaki önceden tanımlanmış koruma türlerini içerir:
Koruma Türleri | Açıklama |
---|---|
ALL | Kullanıcı bu çalışma kitabında hiçbir şeyi değiştiremez |
CONTENTS | Kullanıcı bu çalışma kitabına veri giremez |
OBJECTS | Kullanıcı çizim nesnelerini değiştiremez |
SCENARIOS | Kullanıcı kaydedilmiş senaryoları değiştiremez |
STRUCTURE | Kullanıcı kaydedilmiş yapısı değiştiremez |
WINDOWS | Kullanıcı kaydedilmiş pencereleri değiştiremez |
NONE | Koruma yok |
Aşağıdaki örnek, bir çalışma sayfasını bir şifre ile korumanın nasıl yapıldığını göstermektedir.
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Java | |
// The path to the documents directory. | |
String dataDir = Utils.getSharedDataDir(ProtectingWorksheet.class) + "worksheets/"; | |
// Instantiating a Excel object by excel file path | |
Workbook excel = new Workbook(dataDir + "book1.xls"); | |
// Accessing the first worksheet in the Excel file | |
WorksheetCollection worksheets = excel.getWorksheets(); | |
Worksheet worksheet = worksheets.get(0); | |
Protection protection = worksheet.getProtection(); | |
// The following 3 methods are only for Excel 2000 and earlier formats | |
protection.setAllowEditingContent(false); | |
protection.setAllowEditingObject(false); | |
protection.setAllowEditingScenario(false); | |
// Protects the first worksheet with a password "1234" | |
protection.setPassword("1234"); | |
// Saving the modified Excel file in default format | |
excel.save(dataDir + "ProtectingWorksheet_out.xls"); | |
// Print Message | |
System.out.println("Sheet protected successfully."); |
Yukarıdaki kod çalışma kitabını korumak için kullanıldıktan sonra, korumanın çalışma kitabı üzerinde kontrol edilmesi içindir. Dosyayı açtığınızda ve çalışma kitabına birkaç veri eklemeye çalıştığınızda, aşağıdaki iletişim kutusu görüntülenir:
Kullanıcının çalışma kitabını değiştiremeyeceğine dair bir iletişim kutusu uyarısı
Çalışma kitabında çalışmak için, aşağıda gösterildiği gibi Araçlar menü öğesinden Koruma, ardından Çalışma Kitabının Korumasını Kaldır seçilerek çalışma kitabının korumasını kaldırın.
Koruma Çalışma Çalışma Kitabını Korumasını Kaldır seçmek
Bir iletişim kutusu, bir parola girmenizi isteyerek açılır.
Çalışma tablosunu korumak için parolayı girme
Bazı Hücreleri Koruma
Çalışma kitabında sadece belirli hücreleri kilitlemeniz gereken belirli senaryolar olabilir. Çalışma kitabında belirli hücreleri kilitlemek istiyorsanız, çalışma kitabındaki diğer tüm hücreleri kilitsiz bırakmalısınız. Bir çalışma kitabındaki tüm hücreler zaten kilitlemek için başlatılmıştır, bunu kontrol edebilirsiniz MS Excel’e herhangi bir Excel dosyasını açarak ve Format | Hücreler… tıklayarak Hücreleri Biçimlendir iletişim kutusunu göstermek ve ardından Koruma sekmesine tıklayarak “Kilitli” olarak adlandırılan bir onay kutusu işaretlenmiş olduğunu görebilirsiniz.
Görevi uygulamanın iki yaklaşımı aşağıda belirtilmiştir.
Yöntem1:
MS Excel kullanarak birkaç hücreyi kilitlemenin aşağıdaki adımları açıklar. Bu yöntem, Microsoft Office Excel 97, 2000, 2002, 2003 ve daha yüksek sürümlerine uygulanır.
-
İlk satırın üstünde ve A sütununun solunda yer alan gri dikdörtgen olan Tümünü Seç düğmesine tıklayarak tüm çalışma kitabını seçin.
-
Format menüsünde Hücreleri tıklayın, Koruma sekmesine tıklayın ve ardından Kilitli onay kutusunu temizleyin.
Bu, çalışma sayfasındaki tüm hücreleri kilidini açar.
- Kilitlemek istediğiniz hücreleri seçin ve adım 2’yi tekrarlayın, bu sefer Kilitli onay kutusunu işaretleyin.
- Araçlar menüsünde Koruma seçin, Çalışma Kitabını Koruma‘yı tıklayın ve ardından Tamam‘ı tıklayın.
Yöntem2:
Bu yöntemde, yalnızca görevi gerçekleştirmek için Aspose.Cells API kullanıyoruz.
Aşağıdaki örnek, çalışma kitabında birkaç hücreyi nasıl koruyacağınızı göstermektedir. İlk olarak çalışma kitabındaki tüm hücreleri kilitsiz bırakır ve ardından (A1, B1, C1) 3 hücreyi kilitleyerek çalışma kitabını korur. Son olarak, çalışma kitabını korur. Bir satır/sütun, kilitleme veya kilidi açma yöntemi içeren bir Stil API’sine sahiptir. Bu yöntemi kullanarak satırı/sütunu kilitleyebilir veya kilidini açabilirsiniz.
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Java | |
// The path to the documents directory. | |
String dataDir = Utils.getSharedDataDir(ProtectingSpecificCellsinaWorksheet.class) + "worksheets/"; | |
// Create a new workbook. | |
Workbook wb = new Workbook(); | |
// Create a worksheet object and obtain the first sheet. | |
Worksheet sheet = wb.getWorksheets().get(0); | |
// Define the style object. | |
Style style; | |
// Define the styleflag object. | |
StyleFlag flag; | |
flag = new StyleFlag(); | |
flag.setLocked(true); | |
// Loop through all the columns in the worksheet and unlock them. | |
for (int i = 0; i <= 255; i++) { | |
style = sheet.getCells().getColumns().get(i).getStyle(); | |
style.setLocked(false); | |
sheet.getCells().getColumns().get(i).applyStyle(style, flag); | |
} | |
// Lock the three cells...i.e. A1, B1, C1. | |
style = sheet.getCells().get("A1").getStyle(); | |
style.setLocked(true); | |
sheet.getCells().get("A1").setStyle(style); | |
style = sheet.getCells().get("B1").getStyle(); | |
style.setLocked(true); | |
sheet.getCells().get("B1").setStyle(style); | |
style = sheet.getCells().get("C1").getStyle(); | |
style.setLocked(true); | |
sheet.getCells().get("C1").setStyle(style); | |
// Save the excel file. | |
wb.save(dataDir + "PSpecificCellsinaWorksheet_out.xls", FileFormatType.EXCEL_97_TO_2003); | |
// Print Message | |
System.out.println("Cells protected successfully."); |
Çalışma Sayfasında Bir Satırı Koruma
Aspose.Cells, çalışma tablosundaki herhangi bir satırı kolayca kilitlemenizi sağlar. Burada, çalışma tablosundaki belirli bir satıra stil uygulamak için Row sınıfının applyStyle() yöntemini kullanabiliriz. Bu yöntem iki argüman alır: bir Style nesnesi ve uygulanan biçimlendirmeye ilişkin tüm üyelere sahip olan bir StyleFlag yapısı.
Aşağıdaki örnek, çalışma tablosunda bir satırı korumanın nasıl yapılacağını göstermektedir. İlk olarak, çalışma tablosundaki tüm hücreleri kilidini açar ve ardından ilk satırı kilitler. Son olarak, çalışma tablosunu korur. Bir satır / sütun, bir setCellLocked yöntemi içeren bir Stil API’ye sahiptir. StilFlag yapısını kullanarak satırı / sütunu kilitleyebilir veya kilidini açabilirsiniz.
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Java | |
// The path to the documents directory. | |
String dataDir = Utils.getSharedDataDir(ProtectRowWorksheet.class) + "worksheets/"; | |
// Create a new workbook. | |
Workbook wb = new Workbook(); | |
// Create a worksheet object and obtain the first sheet. | |
Worksheet sheet = wb.getWorksheets().get(0); | |
// Define the style object. | |
Style style; | |
// Define the styleflag object. | |
StyleFlag flag; | |
// Loop through all the columns in the worksheet and unlock them. | |
for (int i = 0; i <= 255; i++) { | |
style = sheet.getCells().getRows().get(i).getStyle(); | |
style.setLocked(false); | |
flag = new StyleFlag(); | |
flag.setLocked(true); | |
sheet.getCells().getRows().get(i).applyStyle(style, flag); | |
} | |
// Get the first Roww style. | |
style = sheet.getCells().getRows().get(1).getStyle(); | |
// Lock it. | |
style.setLocked(true); | |
// Instantiate the flag. | |
flag = new StyleFlag(); | |
// Set the lock setting. | |
flag.setLocked(true); | |
// Apply the style to the first row. | |
sheet.getCells().getRows().get(1).applyStyle(style, flag); | |
sheet.protect(ProtectionType.ALL); | |
// Save the excel file. | |
wb.save(dataDir + "ProtectRowWorksheet_out.xls", FileFormatType.EXCEL_97_TO_2003); | |
// Print Message | |
System.out.println("Row protected successfully."); |
Çalışma Sayfasında Bir Sütunu Koruma
Aspose.Cells, çalışma tablosundaki herhangi bir sütunu kolayca kilitlemenizi sağlar. Burada, çalışma tablosundaki belirli bir sütuna stil uygulamak için Column sınıfının applyStyle() yöntemini kullanabiliriz. Bu yöntem iki argüman alır: bir Style nesnesi ve uygulanan biçimlendirmeye ilişkin tüm üyelere sahip olan bir StyleFlag yapısı.
Aşağıdaki örnek, çalışma tablosunda bir sütunu korumanın nasıl yapılacağını göstermektedir. İlk olarak, çalışma tablosundaki tüm hücreleri kilidini açar ve ardından ilk sütunu kilitler. Son olarak, çalışma tablosunu korur. Bir satır / sütun, bir set Locked yöntemi içeren bir Stil API’ye sahiptir. StilFlag yapısını kullanarak satırı / sütunu kilitleyebilir veya kilidini açabilirsiniz.
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Java | |
// The path to the documents directory. | |
String dataDir = Utils.getSharedDataDir(ProtectColumnWorksheet.class) + "worksheets/"; | |
// Create a new workbook. | |
Workbook wb = new Workbook(); | |
// Create a worksheet object and obtain the first sheet. | |
Worksheet sheet = wb.getWorksheets().get(0); | |
// Define the style object. | |
Style style; | |
// Define the styleflag object. | |
StyleFlag flag; | |
// Loop through all the columns in the worksheet and unlock them. | |
for (int i = 0; i <= 255; i++) { | |
style = sheet.getCells().getColumns().get(i).getStyle(); | |
style.setLocked(false); | |
flag = new StyleFlag(); | |
flag.setLocked(true); | |
sheet.getCells().getColumns().get(i).applyStyle(style, flag); | |
} | |
// Get the first column style. | |
style = sheet.getCells().getColumns().get(0).getStyle(); | |
// Lock it. | |
style.setLocked(true); | |
// Instantiate the flag. | |
flag = new StyleFlag(); | |
// Set the lock setting. | |
flag.setLocked(true); | |
// Apply the style to the first column. | |
sheet.getCells().getColumns().get(0).applyStyle(style, flag); | |
sheet.protect(ProtectionType.ALL); | |
// Save the excel file. | |
wb.save(dataDir + "PColumnWorksheet_out.xls", FileFormatType.EXCEL_97_TO_2003); | |
// Print Message | |
System.out.println("Column protected successfully."); |
Bir Çalışma Sayfasını Korumayı Kaldırma
Microsoft Excel Kullanarak
Microsoft Excel Kullanımı
Çalışma sayfasından korumayı kaldırmak için:
Tabloyu Korumayı Kaldır Seçimi
Koruma kaldırıldı, eğer çalışma tablosu parola ile korunmuşsa bir iletişim kutusu parola için istemde bulunur.
Koruma kaldırılır, ancak elektronik tablonun parola korunmuş olması durumunda bir parola için bir iletişim kutusu belirir.
Çalışma tablosunu korumak için parolayı girme
Aspose.Cells Kullanımı
Bir çalışma tablosu, Worksheet sınıfının Unprotect yöntemi çağrılarak korumasız hale getirilebilir. Aşağıda açıklanan iki şekilde unprotect yöntemi kullanılabilir.
Basitçe Korumalı Bir Çalışma Tablosu Korumasız Yapma
Basitçe korunmuş bir çalışma tablosu, parola ile korunmamış olan çalışma tablosudur. Bu tür çalışma tabloları, bir parametre geçirmeden unprotect yöntemi çağrılarak korumasız hale getirilebilir.
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Java | |
// The path to the documents directory. | |
String dataDir = Utils.getSharedDataDir(UnprotectingSimplyProtectedWorksheet.class) + "worksheets/"; | |
// Instantiating a Workbook object | |
Workbook workbook = new Workbook(dataDir + "book1.xls"); | |
WorksheetCollection worksheets = workbook.getWorksheets(); | |
Worksheet worksheet = worksheets.get(0); | |
Protection protection = worksheet.getProtection(); | |
// The following 3 methods are only for Excel 2000 and earlier formats | |
protection.setAllowEditingContent(false); | |
protection.setAllowEditingObject(false); | |
protection.setAllowEditingScenario(false); | |
// Unprotecting the worksheet | |
worksheet.unprotect(); | |
// Save the excel file. | |
workbook.save(dataDir + "USPWorksheet_out.xls", FileFormatType.EXCEL_97_TO_2003); | |
// Print Message | |
System.out.println("Worksheet unprotected successfully."); |
Parola ile Korunan Bir Çalışma Tablosu Korumasız Yapma
Parola ile korunan bir çalışma tablosu, parola ile korunan bir çalışma tablosudur. Bu tür çalışma tabloları, parolayı parametre olarak alan Unprotect yönteminin aşırı yüklenmiş bir sürümünü çağırarak korumasız hale getirilebilir.
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Java | |
// The path to the documents directory. | |
String dataDir = Utils.getSharedDataDir(UnprotectProtectSheet.class) + "worksheets/"; | |
// Instantiating a Workbook object | |
Workbook workbook = new Workbook(dataDir + "book1.xls"); | |
WorksheetCollection worksheets = workbook.getWorksheets(); | |
Worksheet worksheet = worksheets.get(0); | |
// Unprotecting the worksheet | |
worksheet.unprotect("aspose"); | |
// Save the excel file. | |
workbook.save(dataDir + "UnprotectProtectSheet_out.xls", FileFormatType.EXCEL_97_TO_2003); | |
// Print Message | |
System.out.println("Worksheet unprotected successfully."); |
Excel XP’den bu yana Gelişmiş Koruma Ayarları
Çalışma Tablolarını Koruma, Microsoft Excel 97 ve 2000’de bir çalışma tablosunu korumanın farklı yaklaşımlarını tartışmıştır. Ancak, Excel 2002 veya XP’nin piyasaya sürülmesinden bu yana, Microsoft birçok gelişmiş koruma ayarı eklemiştir. Bu koruma ayarları kullanıcıların şunları yapmasını kısıtlar veya izin verir:
- Satırları veya sütunları sil.
- İçerik, nesneler veya senaryoları düzenle.
- Hücreleri, satırları veya sütunları biçimlendir.
- Satırları, sütunları veya hyperlinkleri ekle.
- Kilitli veya kilitsiz hücreleri seç.
- Özet tabloları ve çok daha fazlasını kullanın.
Aspose.Cells, Excel XP ve sonraki sürümlerinin sunduğu tüm gelişmiş koruma ayarlarını destekler.
Excel XP’de bulunan koruma ayarlarını görüntülemek için:
Araçlar menüsünden Koruma ardından Sayfayı Koru‘yu seçin.
Bir iletişim kutusu görüntülenir. Bir iletişim kutusu görüntülenir.
Excel XP’de koruma seçeneklerini gösteren iletişim kutusu
- İzinleri belirleyin veya kısıtlayın veya bir şifre uygulayın.
Aspose.Cells Kullanarak Gelişmiş Koruma Ayarları
Aspose.Cells, tüm gelişmiş koruma ayarlarını destekler.
Aspose.Cells, bir Microsoft Excel dosyasını temsil eden Workbook sınıfını sağlar. Workbook sınıfı, Excel dosyasındaki her çalışma sayfasına erişim sağlayan WorksheetCollection koleksiyonunu içerir. Bir çalışma sayfası, Worksheet sınıfı tarafından temsil edilir.
Protection özelliğini sağlayan Worksheet sınıfı ise bu gelişmiş koruma ayarlarını uygulamak için kullanılır. Protection özelliği aslında, devre dışı bırakma veya kısıtlamaları etkinleştirmek için çeşitli Boolean özellikleri kapsayan Protection sınıfının bir nesnesidir.
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Java | |
// The path to the documents directory. | |
String dataDir = Utils.getSharedDataDir(AdvancedProtectionSettingsUsingAsposeCells.class) + "worksheets/"; | |
// Instantiating a Workbook object by excel file path | |
Workbook excel = new Workbook(dataDir + "book1.xlsx"); | |
WorksheetCollection worksheets = excel.getWorksheets(); | |
Worksheet worksheet = worksheets.get(0); | |
Protection protection = worksheet.getProtection(); | |
// Restricting users to delete columns of the worksheet | |
protection.setAllowDeletingColumn(false); | |
// Restricting users to delete row of the worksheet | |
protection.setAllowDeletingRow(false); | |
// Restricting users to edit contents of the worksheet | |
protection.setAllowEditingContent(false); | |
// Restricting users to edit objects of the worksheet | |
protection.setAllowEditingObject(false); | |
// Restricting users to edit scenarios of the worksheet | |
protection.setAllowEditingScenario(false); | |
// Restricting users to filter | |
protection.setAllowFiltering(false); | |
// Allowing users to format cells of the worksheet | |
protection.setAllowFormattingCell(true); | |
// Allowing users to format rows of the worksheet | |
protection.setAllowFormattingRow(true); | |
// Allowing users to insert columns in the worksheet | |
protection.setAllowInsertingColumn(true); | |
// Allowing users to insert hyperlinks in the worksheet | |
protection.setAllowInsertingHyperlink(true); | |
// Allowing users to insert rows in the worksheet | |
protection.setAllowInsertingRow(true); | |
// Allowing users to select locked cells of the worksheet | |
protection.setAllowSelectingLockedCell(true); | |
// Allowing users to select unlocked cells of the worksheet | |
protection.setAllowSelectingUnlockedCell(true); | |
// Allowing users to sort | |
protection.setAllowSorting(true); | |
// Allowing users to use pivot tables in the worksheet | |
protection.setAllowUsingPivotTable(true); | |
// Saving the modified Excel file Excel XP format | |
excel.save(dataDir + "APSettingsUsingAsposeCells_out.xls", FileFormatType.EXCEL_97_TO_2003); | |
// Print Message | |
System.out.println("Worksheet protected successfully."); |
Aşağıda küçük bir örnek uygulama bulunmaktadır. Bir Excel dosyası açar ve Excel XP ve sonraki sürümler tarafından desteklenen gelişmiş koruma ayarlarının çoğunu kullanır.
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Java | |
// The path to the documents directory. | |
String dataDir = Utils.getSharedDataDir(AdvancedProtection.class) + "worksheets/"; | |
// Instantiating a Workbook object by excel file path | |
Workbook excel = new Workbook(dataDir + "book1.xls"); | |
WorksheetCollection worksheets = excel.getWorksheets(); | |
Worksheet worksheet = worksheets.get(0); | |
Protection protection = worksheet.getProtection(); | |
// Restricting users to delete columns of the worksheet | |
protection.setAllowDeletingColumn(false); | |
// Restricting users to delete row of the worksheet | |
protection.setAllowDeletingRow(false); | |
// Restricting users to edit contents of the worksheet | |
protection.setAllowEditingContent(false); | |
// Restricting users to edit objects of the worksheet | |
protection.setAllowEditingObject(false); | |
// Restricting users to edit scenarios of the worksheet | |
protection.setAllowEditingScenario(false); | |
// Restricting users to filter | |
protection.setAllowFiltering(false); | |
// Allowing users to format cells of the worksheet | |
protection.setAllowFormattingCell(true); | |
// Allowing users to format rows of the worksheet | |
protection.setAllowFormattingRow(true); | |
// Allowing users to insert columns in the worksheet | |
protection.setAllowInsertingColumn(true); | |
// Allowing users to insert hyperlinks in the worksheet | |
protection.setAllowInsertingHyperlink(true); | |
// Allowing users to insert rows in the worksheet | |
protection.setAllowInsertingRow(true); | |
// Allowing users to select locked cells of the worksheet | |
protection.setAllowSelectingLockedCell(true); | |
// Allowing users to select unlocked cells of the worksheet | |
protection.setAllowSelectingUnlockedCell(true); | |
// Allowing users to sort | |
protection.setAllowSorting(true); | |
// Allowing users to use pivot tables in the worksheet | |
protection.setAllowUsingPivotTable(true); | |
// Saving the modified Excel file Excel XP format | |
excel.save(dataDir + "AdvancedProtection_out.xls", FileFormatType.EXCEL_97_TO_2003); | |
// Print Message | |
System.out.println("Worksheet protected successfully."); |
Hücre Kilitleme Sorunu
Hücreleri düzenleme yasağını kullanıcıların sınırlandırmak istiyorsanız, koruma ayarları uygulanmadan önce hücrelerin kilidini yapmanız gerekmektedir. Aksi takdirde, sayfa korunmuş olsa bile hücreler düzenlenebilir. Microsoft Excel XP’de, hücreleri aşağıdaki iletişim kutusu aracılığıyla kilitleyebilirsiniz:
Excel XP’de hücreleri kilitlemek için iletişim kutusu
Aspose.Cells API’sını kullanarak hücreleri kilitlemek de mümkündür. Her hücrenin bir Style API’si vardır ve bunun içinde hücreleri kilitlemek veya kilidini açmak için setLocked yöntemini içerir.
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Java | |
// The path to the documents directory. | |
String dataDir = Utils.getSharedDataDir(LockCell.class) + "worksheets/"; | |
// Instantiating a Workbook object by excel file path | |
Workbook excel = new Workbook(dataDir + "Book1.xlsx"); | |
WorksheetCollection worksheets = excel.getWorksheets(); | |
Worksheet worksheet = worksheets.get(0); | |
worksheet.getCells().get("A1").getStyle().setLocked(true); | |
// Saving the modified Excel file Excel XP format | |
excel.save(dataDir + "LockCell_out.xls", FileFormatType.EXCEL_97_TO_2003); | |
// Print Message | |
System.out.println("Cell Locked successfully."); |