How to unhide a worksheet in excel using VBA if the workbook is protected -
i have workbook in excel , workbook password protected. have 2 sheets in 's1' , 's2'. 's1' protected , hidden. have added button in 's1' when pressed unhides 's1'. using following code:
private sub commandbutton2_click() sheets("s1").visible = true end sub
i using userinterfaceonly:=true
but throws error "unable set visible property of worksheet class"
it throws same error when try hide sheet under same circumstances
how fix problem without compromising safety of workbook
Comments
Post a Comment