excel vba - User can unprotect vba protected sheets without providing the password -


i've placed worksheets protection lines follows:

private sub workbook_open()    worksheets("sheet1").protect password, userinterfaceonly:=true   worksheets("sheet1").protect allowfiltering:=true    worksheets("sheet2").protect password, userinterfaceonly:=true   worksheets("sheet2").protect allowfiltering:=true    worksheets("sheet3").protect password, userinterfaceonly:=true   worksheets("sheet3").protect allowfiltering:=true    worksheets("sheet4").protect password, userinterfaceonly:=true   worksheets("sheet4").protect allowfiltering:=true  end sub 

however, whenever click unprotect worksheet main menu, excel doesn't ask password , unprotects sheet. doing wrong here?

thanks all!

worksheets("sheet1").protect password, userinterfaceonly:=true, allowfiltering:=true 

do each line , should work well, assuming did put password sting variable password


Comments

Popular posts from this blog

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -