I am new to google sheets and scripts. I have created a searchable product list in google sheet and created a button clear the contents(not the formulas). Everything will work fine when I logged in. If i share the link with someone the script is not working and showing an error. The sheet is perfectly working.
function myFunction() {
var sheet = SpreadsheetApp.getActiveSheet();
var rangeList = sheet.getRangeList(['A8', 'E24']);
rangeList.clear({contentsOnly: true});
}
Is there any way to resolve this, please?