My application first creates a worksheet using Aspose.Cells verion 7.3.
The worksheet is protected with the following code:
Protection protection = workbook.Worksheets[0].Protection;<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
protection.AllowInsertingRow = true;
protection.AllowDeletingRow = true;
protection.AllowSelectingLockedCell = true;
worksheet.Protect(ProtectionType.All);
This spreadsheet is correctly protected, the correct cells are locked and rows can be inserted.
However, the second step in the application is to make the generated spreadsheet available on a web page via Aspose.Cells.GridWeb version 2.7.8.200. The user can save the generated spreadsheet by clicking the save button.
<acw:GridWeb … onsavecommand="GridSaveCommand" …
protected void GridSaveCommand(object sender, EventArgs e)
{
MemoryStream memoryStream = new MemoryStream();
billGrid.WebWorksheets.SaveToExcelFile(memoryStream);
Response.ContentType = "application/vnd.ms-excel";
Response.AddHeader("content-disposition", "attachment; filename=" + ConfigurationManager.AppSettings["DefaultFileSaveName"]);
Response.OutputStream.Write(memoryStream.GetBuffer(), 0, (int)memoryStream.Length);
Response.End();
}
The spreadsheet saved via Aspose.Cells.GridWeb is fully protected and does NOT ALLOW THE USER TO INSERT ANY ROWS. How did it lose its protection settings of AllowInsertingRow?