I'm having trouble running even the simplest Google Apps Scripts, for instance when I run this script by setting a cell my spreadsheet to =pantsHate(Y) I'm getting this error:
error: You do not have permission to call msgBox
function pantsHate(pref) {
var preference = pref;
switch (preference) {
case "Y":
Browser.msgBox("You hate pants.");
break;
case "N":
Browser.msgBox("You do not hate pants.");
break;
default:
Browser.msgBox("You hate answering Y or N");
break;
}
return pref;
}
My end goal is to write a small function to manipulate dates, specifically I need to find exactly how many days have passed between two dates (leap years, specific days / month, etc are all factors). This program was just a test but I seem to be doing something wrong already... any help is greatly appreciated!
Update: I tried this in a new project and it worked... arg! Update 2: Ran it again with =pantsHate("Y") and I got the same error, in this "new" project... why Google, why?