Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default How do I protect Excel Workbook Structure except adding new sheets

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 ?


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 622
Default 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.
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
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.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 622
Default How do I protect Excel Workbook Structure except adding new sh

On Jun 20, 4:50 pm, Som_Dev wrote:
Hi Spiky,
Thank you very much for your reply. Do you know How to create custom button
in the toolbar of the sheet ?


Toolbar buttons stay with the computer generally, not with the
workbook. So I always make buttons right in a worksheet with the Text
Box drawing tool. This also allows for a real name to show for the
button instead of a tiny picture since the text box can be as large as
you like.

Create a Text Box however you like, I usually add some background
color, rounded corners and shadowing so it looks more like a button.
Right-click on the box and choose Assign Macro. You already have to
have your macro created so you can just pick it from the list. The box
will become clickable, probably with a pointing finger cursor like for
a hyperlink.

Locking the sheet means they cannot mess up the text box/button you
just made.
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Protect an Excel 2007 workbook structure Austrian Hannes Excel Discussion (Misc queries) 2 March 19th 08 03:21 PM
Use Macro to protect choosen sheets in workbook kevhatch Excel Discussion (Misc queries) 1 January 27th 07 06:52 PM
Adding sheets to workbook Susan Excel Worksheet Functions 4 October 23rd 06 05:55 PM
Macros for Protect/Unprotect all sheets in a workbook Paul Sheppard Excel Discussion (Misc queries) 2 August 4th 05 04:30 PM
How can I protect several sheets in a workbook simultaneously? Fran crisp Excel Discussion (Misc queries) 1 June 20th 05 12:15 PM


All times are GMT +1. The time now is 08:55 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"