Free Support Forum - aspose.com

WorkbookDesigner.Save on Protected Worksheet

I have a template created that has a protected worksheet with Contents Only as the protection type. The sheet has option buttons on it that are linked to other cells on the sheet. The option buttons and the linked cells are both protected because I do not want the user to change those values. But I do put values into those cells using the PutValue method.

Upon running the WorkbookDesigner.Save method in the following manner,

designer.Save(fileName, SaveType.OpenInExcel, FileFormatType.Default, httpResponse);

and I hit Open (instead of Save when prompted), I get a Microsoft Excel error.

Microsoft Excel Error..."The cell or chart you are trying to change is protected and therefore read-only. To modify a protected cell or chart, first remove protection using the Unprotect Sheet command (Tools menu, Protection submenu). You may be prompted for a password."

If I then Save that document to my desktop and then open it back up, it will not give me the error. But if I hit Save from the web browser prompt on whether to Open or Save the Excel document and then open that Excel document, it will still give me the error message.

I have tested this process out on a Vista machine with Excel 2007 on it and it will not give the error messages. But our users are still stuck on Windows 2000 with Excel 2000. Does anyone know if there is a way to prevent this error from happening upon opening the Excel document from the .net application in Excel 2000?

Hi,

Well, we think you may try to add a line (at the end):
Response.End();
after your line of code (for saving the spreadsheet) to check if it works fine on Excel 2000 version.

Thank you.