Link to home
Start Free TrialLog in
Avatar of Kanwaljit Singh Dhunna
Kanwaljit Singh DhunnaFlag for India

asked on

Disable Freeze Panes in Excel

Hi Experts,

I have protected one sheet using password and Freeze panes have been applied. But I noticed that even if the sheet is protected one can always change the Freeze Panes Settings.

I require some VB code to disallow any changes to freeze panes settings.

Regards
Kanwal
Avatar of TazDevil1674
TazDevil1674
Flag of United Kingdom of Great Britain and Northern Ireland image

What version of Excel are you using?  I am using 2007 and if I freeze panes and protect sheet, I cannot remove/change freeze panes
Avatar of Rgonzo1971
Rgonzo1971

HI,

This could do it

Private Sub Worksheet_Activate()
Application.CommandBars("Window").Controls(7).Enabled = False
End Sub


Private Sub Worksheet_Deactivate()
Application.CommandBars("Window").Controls(7).Enabled = True
End Sub

Open in new window

Regards
Avatar of Kanwaljit Singh Dhunna

ASKER

I am using Excel 2003 and Excel 2010.

Hi Rgonzo1971, I put this code in the worksheet code window. It is working in Excel 2003 but it is not working in Excel 2010.

Regards
Kanwal
For 2010 (and also other?)

ActiveWindow.FreezePanes = False
Hello MartinLiss,

It is not that I don't want to use Freeze Panes. I only wish that no one touches the freeze pane settings done by me.

Regards
Kanwal
This is an article on Enabling/Disabling custom ribbon buttons. I couldn't get it to work for the built-in buttons but maybe you can.
ASKER CERTIFIED SOLUTION
Avatar of Rgonzo1971
Rgonzo1971

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial