
Using(var document = SpreadsheetDocument. Package spreadsheetPackage = Package.Open(destinationFile, FileMode.Open, FileAccess.ReadWrite) Note : Here I've mentioned the code only to read the existing file and insert the row and cells and lock the cells which have been inserted manually From the Protect Workbook dialog box, select Advanced Protection. Then, go to the Review tab and select Protect Workbook. Find this one, it'll very helpful to you. To make an Excel file read-only except for you, you can use the Protect Workbook feature. Here I gave you full code to open the file from directory and insert cells. NET Standard assemblies in UWP platform.I've referred the following link Excel File Password Protection with Open XML SDK. Open the MS Excel for Mac file you want to encrypt and password protect. Encrypt and Decrypt can be performed by referring. To password protect and/or encrypt a document using Microsoft Excel for Mac: 1. You can unprotect or remove protection for a workbook as shown below. using ( ExcelEngine excelEngine = new ExcelEngine ()) Unprotect Workbook elements

Encrypt and Decrypt can be performed by referring. The Following code snippets illustrate how to achieve the above options. This can be set with or without requiring a password to open the file. Read - Only Recommended – If the excel file is set as Read-only recommended, then Microsoft Excel displays a message recommending that you open the workbook as read-only when users open the excel file.

To keep others from making structural changes to your documents such as moving, deleting and adding sheets, you can protect the workbook in the following ways. To enter the Visual Basic Editor press ALT+F11. You can protect an anonymous user from viewing, moving, editing or deleting important data from a worksheet or workbook by protecting a worksheet or workbook, with or without a password. Security in Excel (XlsIO) Library (Excel Protected View)
