How to Protect Office 365 workbook

Dear Expert,

I am having issue that the excel workbook in SharePoint and the file is shared via One Drive. What I need to do is to protect the workbook in drive before robot reading range directly in order to avoid users update some cells during robot is processing the data table.
I can’t find to protect workbook within office 365 scope via background service and let us know if there any solution for this.