I had the same problem. (Apparently Microsoft still didn’t fix this bug.)
In the registry, I found that the command for "Open as Read-Only" is "C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE"/h"%1".
But, according to the documentation, it should be /r.
https://support.microsoft.com/en-us/office/command-line-switches-for-microsoft-office-products-079164cd-4ef5-4178-b235-441737deb3a6#Category=Excel
I changed it in the registry, now it works.
Solution
⚠️ WARNING
Editing the registry incorrectly can damage your system and
can result in data loss or the need to reinstall your system!
Note
You have to change the installation path, according to you installation.
I Use Excel 2019, which apparently is version 16.
If you change it in the registry, use the path that is already there and just change /h to /r.
Go to [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Excel.Sheet.12\shell\OpenAsReadOnly\command]
and change (Default)
from "C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" /h "%1"
to "C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" /r "%1".
Alternative
Create a .reg file with following content:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Excel.Sheet.12\shell\OpenAsReadOnly\command]
@=""C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" /r "%1""
Remember to change the installation path accordingly to your installation.
Now you can install that reg file.