Compiled workbook protect a certain range on full access to save


How can you allow only a certain range to be protected but then a certain part can be edited. See below. In the exe to be compiled this is the settings -this overwrite excel protection

The red columns I would like to protect and only allow the orange columns to be updated -how can I achieve this on the compiled file. Formula protection only protect formulas -in my case I want to block any amendmend of the red columns data only allowing the orange ranges to be edited in excel.Can this be done support ??? Keep in mind my save settings above

Sorry, don’t understand what you want to do exactly.


Currently my one sheet are protected so that people can not change data on certain ranges. It works in excel.See my code below

Sub protect

Sheets(“Calc”).Protect Password:=“Pass123Z!”, UserInterFaceOnly:=True

Call sumit
End Sub

Sub sumit()

Dim mainworkBook As Workbook

Set mainworkBook = ActiveWorkbook

mainworkBook.Sheets(“Calc”).Range(“A2:O2”).Locked = False

mainworkBook.Sheets(“Calc”).Protect Password:="Pass123Z!"
End Sub

Sub Macro5()
ActiveSheet.Unprotect "Pass123Z!"
Cells.Locked = False
Columns(“AF:AF”).EntireColumn.Locked = True
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
End Sub

If I compile the exe file my locked ranges dont work anymore so I presume the code must be changed ?. After the compile of exe the column I am protecting can be changed due to my save settings overwrite the code

In Excel you select the data then you lock it then apply password to protect that data to prevent it from being overwritten. If I compile the exe none of that code to protect the range work anymore

I solved it thank you support