This script freezes (locks) the first row of a Google Sheet. It also has the ability to freeze a column. Copy the script file and then choose to run one of the functions. You will be asked the first time to authenticate with your Google Workspace account.
Choose to freeze row or column or clear previous row or column locks.