1

This is probably a dumb newbie question, but I have a spreadsheet that I want to make available to anonymous users by just giving them the URL. After a lot of hair-pulling I now have the cell protection rain dance figured out, but I have another problem.

The original sheet's onOpen works fine for me and creates a custom menu, but when I share the sheet and open it as an anonymous user, no menu appears. Fine, thought I, it isn't the first time Google's stuff doesn't work as advertised. So then I went ahead and created a button to do the action that the missing menu couldn't do. Same story. Button appears to anonymouse user but it is dead. No action on click.

It doesn't seem possible that javascript would be disabled for anonymous users, but that's what it looks like. Any suggestions?

2
  • 2
    What cell protection dance? You just share the doc as public write. Or? Commented Apr 19, 2014 at 3:26
  • 1
    No. I was referring to a separate problem. To protect individual cells you have to make the sheet private to just yourself, then change the protection, then re-share it. You cannot protect cells when the document is in shared status. Typical Google: sloppy work and undocumented. Commented Apr 20, 2014 at 15:18

1 Answer 1

1

I think you're right user3550481. I replicated what you described above and made up this spreadsheet to test what you reported. It has a "My Menu" menu that should appear onOpen and a button with a script assigned to the same function. It didn't make any difference whether Sharing was set to "Anyone with the link" or "Public". I even tried Publishing the script as a webapp accessible to Anyone even anonymous - I didn't expect that to make any difference because it obviously has no doGet function - and it didn't.

When I tested as an anonymous user, i.e. not signed into any Google account, the "My Menu" menu did not show up and the button was, as you say, dead.

Once I signed into a Google account, both worked but intriguingly the revision history shows the results as anonymous.

I'll be very interested to see if anyone offers a better solution than reporting it to the Issue Tracker - if you don't I probably will. In the meantime, whenever you share the link with your users the best thing would be to explain that they'll need to sign in to a Google account for it to work properly - which after all is free.

Script used in the spreadsheet:

function onOpen() {
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var myMenu = [ {name: 'My Menu', functionName: 'myMenu'}];
  ss.addMenu('My Menu', myMenu);
}

function myMenu() {
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var sh = ss.getSheetByName('Sheet1');
  var lr = sh.getLastRow()+1;
  sh.getRange(lr, 1).setValue('Clicking My Menu worked!');
}
Sign up to request clarification or add additional context in comments.

3 Comments

Thanks for the effort. I just posted it on the Issue Tracker: #3917
I starred your issue.
Link to the referred issue issuetracker.google.com/issues/36759182. It's has status fixed but I'm having this problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.