67
Views
6
Comments
Solved
[Advanced Excel] Disable number of columns into excel from editing.
advanced-excel
Service icon
Forge asset by Carlos Freitas
Application Type
Reactive

Hi OS community,

i want to disable excel column when i download that excel from my dashboard. Also i want to disable header row so no one can change that header. I also want to enable few columns in that excel so that user can update the value manually and upload again. 

2025-09-25 22-50-38
Hanno
Solution

Hi Devanshu

If you look at the sample application, Sample04 specifically, you'll see how to protect the worksheet (with or without password) but also how to allow certain cells to still receive user input.

When setting the protection options for the worksheet, be sure to set AllowSelectUnlockedCells to True.


When setting the worksheet protection, the whole sheet will be protected, so you need to specify the cells/columns/rows that you don't want protected using the CellFormat_ApplyToRange action.

Let's say we want to set the entire column C and row as editable, then we use Address_From_Text action with"C:C:" as input to get the range for column C and we use Address_From_Text with parameter "7:7" to get the range for row 7. The Address_From_Text action will return the entire range as row +col values that we can use in the next action CellFormat_ApplyToRange to set the cells as Unlocked.


I've attached an updated version of the Demo app that will show you (Sample04) how to do that.

Hope this helps.

Hanno

Advanced Excel Demo.oap
UserImage.jpg
Devanshu Prasad

Thankyou @Hanno for your solution it works for me actually last night i achieve exactly what i want i find one of your old solution and implement it and it works for me.

Post Link

 Thanks 

2023-10-26 15-12-53
Mohammed Rizwan

Hi @Hanno 

I have tried this and its work but just facing one issue while opening excel in ms office right click on sheetname and just clicked on unprotect sheet its unlock all the column i want to restrict this like when someone try to unprotect its asked for password i have tried to put password in worksheet_protect function but its not working any suggestions how to handle this.

Thanks

Rizwan 

2025-09-25 22-50-38
Hanno

Hi Mohammed

I'll have a look as soon as I can.

Do you perhaps have an .oml you can share in the meantime? If not, that is okay.

Hanno

2021-06-03 11-03-21
Anubhav Rai

Hi Devanshu,
By default all cells of Excel are protected you just need to enable the "protect" property of the worksheet, this is what I got from Google.
I have not checked this in OS but you might get your solution by using the below selected features.
Please let me know if you have any queries.


Regards,

2025-08-03 07-20-35
Mythily - EONE

Hi,

This workbook_Protect / worksheet_protect - set protection on the workbook/worksheet level (By Password)

2025-09-25 22-50-38
Hanno
Solution

Hi Devanshu

If you look at the sample application, Sample04 specifically, you'll see how to protect the worksheet (with or without password) but also how to allow certain cells to still receive user input.

When setting the protection options for the worksheet, be sure to set AllowSelectUnlockedCells to True.


When setting the worksheet protection, the whole sheet will be protected, so you need to specify the cells/columns/rows that you don't want protected using the CellFormat_ApplyToRange action.

Let's say we want to set the entire column C and row as editable, then we use Address_From_Text action with"C:C:" as input to get the range for column C and we use Address_From_Text with parameter "7:7" to get the range for row 7. The Address_From_Text action will return the entire range as row +col values that we can use in the next action CellFormat_ApplyToRange to set the cells as Unlocked.


I've attached an updated version of the Demo app that will show you (Sample04) how to do that.

Hope this helps.

Hanno

Advanced Excel Demo.oap
UserImage.jpg
Devanshu Prasad

Thankyou @Hanno for your solution it works for me actually last night i achieve exactly what i want i find one of your old solution and implement it and it works for me.

Post Link

 Thanks 

2023-10-26 15-12-53
Mohammed Rizwan

Hi @Hanno 

I have tried this and its work but just facing one issue while opening excel in ms office right click on sheetname and just clicked on unprotect sheet its unlock all the column i want to restrict this like when someone try to unprotect its asked for password i have tried to put password in worksheet_protect function but its not working any suggestions how to handle this.

Thanks

Rizwan 

2025-09-25 22-50-38
Hanno

Hi Mohammed

I'll have a look as soon as I can.

Do you perhaps have an .oml you can share in the meantime? If not, that is okay.

Hanno

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.