How do I protect Excel Workbook Structure except adding newsheets
On Jun 20, 1:02 pm, Som_Dev wrote:
Hi,
I am exporting some application data to Excel workbook through my C# code.
I would like to Lock the Workbook to prevent users to edit the name of the
sheet and some column data.
But I need to allow user to add new sheet.
Workbook.Protect method allows me to Lock the Structure of the workbook
which includes not allowing to add new sheet.
But As I said I need allow user nothing but adding newworksheet.
How Do I do that ?
You could create a macro that unprotects the workbook, adds a sheet,
then protects the workbook again. And give the users a button to
operate it. And password protect your VBA so they can't see the
workbook password in your code, which shows as plain text.
|