View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Som_Dev Som_Dev is offline
external usenet poster
 
Posts: 2
Default How do I protect Excel Workbook Structure except adding new sh

Hi Spiky,
Thank you very much for your reply. Do you know How to create custom button
in the toolbar of the sheet ?

"Spiky" wrote:

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.