In Excel Web, you can set a workbook to open in read-only mode but encrypting a workbook with a password isn't currently possible. You can, however, Encrypt a workbook in the Excel desktop app.
-
To open the desktop app, at the top of the ribbon, select Editing > Open in Desktop App.
Don't have the Excel desktop app? Try or buy Microsoft 365.
-
Go to the File tab and select Passwords.
-
Add Password to open and Password to modify and select OK.
-
Reenter passwords as asked, selecting OK with each
-
Save the file.
For more info, see Protect a worksheet in Mac.