Reputation: 1981
Trying to run
function textVersion() {
var app = UiApp.createApplication().setTitle('Time Picker');
var main = app.createGrid(2, 4);
var date = app.createDateBox().setName('date');
var hour = app.createTextBox().setName('time').setWidth('150');
var button = app.createButton('validate')
main.setWidget(0,0,app.createLabel('Choose Date')).setWidget(0,1,app.createLabel('Enter Hours:minutes'))
main.setWidget(1,0,date).setWidget(1,1,hour);
main.setWidget(1,3,button)
var handler = app.createServerHandler('show2').addCallbackElement(main)
button.addClickHandler(handler)
app.add(main)
ss=SpreadsheetApp.getActive()
ss.show(app) // here is problem , how to fix that ?
}
but have this error you do not have permission to call SHOW
Upvotes: 0
Views: 463
Reputation: 844
This is true. If I am correct, you made a function and are trying to use it in your spreadsheet in a cell like "=textVersion()". Is that correct? It happens in circumstances where you are trying to run a custom function from a cell, and that function has illegal elements like "ss.show()".
Please correct me because I am assuming some things here. But if my assumptions are correct so far, what you need here is a button instead, so you can (in the top menu of the spreadsheet) Insert > Image. Then right click on the image and Assign the script "textVersion" to it. Then the UI should work now since it is being called by a person rather than your spreadsheet.
Upvotes: 1