Thanks David. I am using the following code. This locks the worksheet, but at the same time allows me to change column/row width and allows to expand/contract grouped rows and columns.
Code:
ActiveWorkbook.Protect Structure:=True, Windows:=False, Password:=12345
ActiveSheet.EnableOutlining = True
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True, Password:=PWord, UserInterfaceOnly:=True, AllowSorting:=True, AllowFormattingColumns:=True, AllowFormattingRows:=True, AllowFormattingCells:=True