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

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -