Password lock everything in sheet

pedie

Well-known Member
Joined
Apr 28, 2010
Messages
3,875
Hi,
Can password lock everything in sheet including the view tab....As i dont want the user to be able to
unfreeze(which is now working), + i dont want them to be able to click on formula bar check box and headings...
Is there a way to achieve this as normally it cant be?
Thanks for suggesting.
Pedie
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Hi.

You can hide pretty much anything. In XL 2007+ you'd need to hide the ribbon and QAT as well. This will only work if macros are enabled:

Code:
Sub DictatorApplication()
Dim cBar As CommandBar
Application.ScreenUpdating = False
ThisWorkbook.Protect Windows:=True
With ActiveWindow
    .WindowState = xlMaximized
    .DisplayHorizontalScrollBar = False
    .DisplayVerticalScrollBar = False
    .DisplayWorkbookTabs = False
    .DisplayHeadings = False
End With
With Application
    .DisplayFormulaBar = False
    .DisplayStatusBar = False
End With
For Each cBar In CommandBars
    cBar.Enabled = False
Next cBar
Application.ScreenUpdating = True
End Sub
 
Upvote 0
Peter, this is cool and pretty much everything but i can still click on formula bar check box under view tab. I also want to disable that...please.
Thanks again!;)
 
Upvote 0
You can hide the ribbon like this

Code:
Application.SendKeys ("^{F1}") 'hide ribbon (Yuk! but it works)

Not sure about the QAT. I don't think that is accessible from VBA.
 
Upvote 0
But still I can click on view...lol!:biggrin:

Thats k, Peter. This much will do.

You have a great weekend!:)
 
Upvote 0
Sorry but how to bring things back to normal??? after executing this code????

is this it?
Code:
ThisWorkbook.Protect Windows:=False
 
Upvote 0
Thanks again!<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
 
Upvote 0

Forum statistics

Threads
1,223,710
Messages
6,174,019
Members
452,542
Latest member
Bricklin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top