Ethan Goldberg
Ethan Goldberg

Reputation: 89

Adding a script to a cell in Google Sheets with Dialog Box

How can I add a script to a cell in Google Scripts with a dialog box? When I try to do it now, I am getting this error:

You do not have permission to call show (line 19).

This is because, in the script, I am trying to call:

var app = UiApp.createApplication(); 
var doc = SpreadsheetApp.getActive(); 
doc.show(app);

I know I can do this with a button on top of the cell, but I am wondering if there is a cleaner way of doing it. I want to be able to access the cell that I am clicking (ex. A1), and with a button overlayed on the sheet, am I able to get the cell? Thank you!

Upvotes: 1

Views: 468

Answers (1)

Wicket
Wicket

Reputation: 38416

It looks that your are trying to use a custom function in Google Sheets. Custom functions can't open UI elements. See Using Apps Script Services to learn wich services could be used on custom functions.

Upvotes: 0

Related Questions