• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Remove Insert New Sheet Key

hoomantt

Member
Hi Proffessors ;

I want to remove the Insert New worksheet of an excel file.that nobody cant insert new sheet to my file and every body that have a password can insert page(s) to this file and when open this file there is not a key in right side botoom of the excel file;

thanks all you .

thanks . . .
 
Hi hoomantt,


Copy and paste the below code in "ThisWorkbook" code module(press ALT+F11, double click on "ThisWorkbook",Paste code into the right pane) and save the workbook:


Private Sub Workbook_NewSheet(ByVal Sh As Object)


With Application

.ScreenUpdating = False

.DisplayAlerts = False


ActiveSheet.Delete


MsgBox "Cannot add new sheets!", 16


.DisplayAlerts = True

.ScreenUpdating = True

End With


End Sub


Now go back to excel sheet and try adding any sheet. You will be prevented from doing so and will also get a warning message.


Hope this helps.


Kaushik
 
If you goto the Review Tab, Protect Workbook

Select Protect Workbook Structure and assign a password, that will do it
 
I have used Hui's method in the past and it works, as we all know Excels password protection can be broken but this type of protection does stop your non-Excel savie user from doing any damage where as it is relativley easy to view code and delete it.
 
Back
Top