Very efficient and clear descriptions. That you often also identify and explain common issues, and likely potential modifications to the code in your videos, is also very helpful. Nice work.
Hello great man! greetings from Italy! i used the quarantain to learn about AppScripts from you and i want to thank you. i got a question: how can i run the same script on bulk of spreadsheets in the same folder? thank you again!
Nice beginner video, thank you! Do you have videos about add-on creation for google sheets? I'd especially be interested in understanding the whole publishing process step-by-step for a public add-on, as this is truly a pain.
I tried sharing the Google sheet with the custom menu I have created with other users but they are unable to see the custom menu. Any way to make it visible to them?
Nice video...any way to modify the existing bar? Like adding + / - on the Font Size so one does not have to open a drop down and select size but rather just hit a plus or minus button?
@@ExcelGoogleSheets I binged them:) Quite versed on coding of all kinds, so they're a bit slow for me, but I could easily skip to the important stuff. I imagine this series is a godsend for beginners. All power to you bro! Tnks again.
I found it on Google's development page: developers.google.com/apps-script/guides/menus Otherwise, here's the code Google provides that worked for me: function onOpen() { var ui = SpreadsheetApp.getUi(); // Or DocumentApp or FormApp. ui.createMenu('Custom Menu') .addItem('First item', 'menuItem1') .addSeparator() .addSubMenu(ui.createMenu('Sub-menu') .addItem('Second item', 'menuItem2')) .addToUi(); } //end onOpen() function// function menuItem1() { SpreadsheetApp.getUi() // Or DocumentApp or FormApp. .alert('You clicked the first menu item!'); } //end menuItem1() function// function menuItem2() { SpreadsheetApp.getUi() // Or DocumentApp or FormApp. .alert('You clicked the second menu item!'); } //end menuItem2() function//
Hi, thanks for this interesting video. Is there a way to create a gui interface (perhaps using html code) and show it to the user to capture info and write that info into some sheets cell ?
Hello! Can you help with this issue? To create dynamic menu (items) from google sheets rows by using apps script. For example, when a range of rows is changed so the menu items are changed as well. Thank you.
Having serious problems adding a custom menu. Have tried multiple ways then tried yours and it still is failing at some point with no indication of where. If you or any one in the comments is willing to help, I'd love the help.
Since there is no need to declare a variable for a menu anymore, are you thinking about revisiting the subject and creating a new video sometime? I've been trying to create a menu with some submenus and I've been having difficulties, mainly because I can't copy your code anymore :( Thanks
function initMenu() { var udi = SpreadsheetApp.getUi(); var menu = udi.createMenu("Classes"); menu.addItem("7A-7b", "sevenA"); menu.addToUi;
} function onOpen(){ initMenu(); } function sevenA() { SpreadsheetApp.getActiveSpreadsheet().getActiveSheet().getRange("a1").setValue(new Date()) } I tried to follow the syntax of your code, but the new menu doesn't come out, is there any wrong with my code?
pls help im getting an error that says "TypeError: Cannot read property 'getActiveSheet' of null (line 3 file "Code")" Edit wait nvm i just needed to rewatch the tutorial
Hi sir, hello followers, i found an issue by the onOpen event. If you declare GLOBAL variables that, in my case, refer to another spreadsheet, the event onOpen doesn't build your custom menu. Your script will still work and your custom menu will be built if you run the script from the script editor. Solution: 1) Avoid GLOBAL variables in your script file. 2) Build the men running the script from the script editor (make less sense). 3) Create an Textbox or Image in the sheet and assign it the script that build the menu, in this case make also no sense to call the script onOpen. Did someone had the same issue like me? Hope this was helpful Have a nice day
I want to make a form of website to login as admin, or login as staff. -Admin can edit staff. -After logining: Multiple staffs can edit, view, update in the same time in the page like google sheet. -After staffs access and edit, data auto saved in files and we can print it normally. So what series can figure it? Need someone helps
@@ExcelGoogleSheets Thanks for the reply :). What would you recommend for handling the UI of time-based triggers then? I'm coding a menu item that when clicked, will trigger a time-based triggers. This seems suboptimal because I can accidentally click it a second, or third time, and end up with a lot of unwanted triggers.
Do things up date that quick? New sheet. New script. Copy exactly what you do and get ReferenceError: date is not defined (line 3, file "code"). Also what cannot call spreadsheet from this Ui even mean? If the spreadsheet is open in te next tab then surely te ActiveSheet should mean that.
Can you add UI and have certain shared users who only have read access to be able to edit certain cells in a UI created by a script? I am really lazy to do a whole python app for this please someone say yes.
//This is where we acces the UI var ui = SpreadsheetApp.getUi();
//create our main menu var menu = ui.createMenu("My Macros");
//add regular items to our main menu menu.addItem("My Time Macro", "myMacro"); menu.addItem("Another One", "myMacro"); menu.addSeparator(); menu.addItem("Third One", "myMacro"); menu.addSeparator();
//create a submenu ad add it to our main menu var submenu = ui.createMenu("Special Functions"); submenu.addItem("Show The Box", "showMessage"); submenu.addItem("Same Date Function", "myMacro"); menu.addSubMenu(submenu);
//create another submenu ad add it to our main menu var submenu2 = ui.createMenu("Special Functions"); submenu2.addItem("Show The Box", "showMessage"); submenu2.addItem("Same Date Function", "myMacro"); menu.addSubMenu(submenu2);
//render all of the above menu.addToUi();
} function onOpen(){ initMenu(); }
function myMacro() { SpreadsheetApp.getActiveSpreadsheet().getActiveSheet().getRange("a1").setValue(new Date());
} function showMessage(){ SpreadsheetApp.getUi().prompt("You did it!"); }
Dude, You're easier to understand than all of the professors I had back when I was in college for a comp sci degree.
agree...
Very efficient and clear descriptions. That you often also identify and explain common issues, and likely potential modifications to the code in your videos, is also very helpful. Nice work.
This deserves way more likes, so easy to understand, great work.
Another brick in Google Apps programming
Thank you!
You are the BOSS!
I've learned from you a lot. Thanks
Hello great man! greetings from Italy! i used the quarantain to learn about AppScripts from you and i want to thank you.
i got a question: how can i run the same script on bulk of spreadsheets in the same folder?
thank you again!
This should help you ruclips.net/video/tmKqry4EKdQ/видео.html
You're a life saver thankyou!
Nice beginner video, thank you! Do you have videos about add-on creation for google sheets? I'd especially be interested in understanding the whole publishing process step-by-step for a public add-on, as this is truly a pain.
I tried sharing the Google sheet with the custom menu I have created with other users but they are unable to see the custom menu. Any way to make it visible to them?
Your videos are great, I wish you had a github repo with your source in it for reference.
Takes too much time to manage these. I have to pick my battles.
Cool... you are the best...
Great Videos I must say , well elaborated .
Nice video...any way to modify the existing bar? Like adding + / - on the Font Size so one does not have to open a drop down and select size but rather just hit a plus or minus button?
Keep rocking!
Nice sir
Amazing! Thanks for these
Glad you like them!
@@ExcelGoogleSheets I binged them:) Quite versed on coding of all kinds, so they're a bit slow for me, but I could easily skip to the important stuff. I imagine this series is a godsend for beginners. All power to you bro! Tnks again.
Hi sir, I copied exactly what u do but there is an error: cannot call SpreadsheetApp. getUi() from this context. (Line 2,file) . What should I do?
I'm getting the same error. I've checked my work a number of times. Was there an update?
I found it on Google's development page: developers.google.com/apps-script/guides/menus
Otherwise, here's the code Google provides that worked for me:
function onOpen() {
var ui = SpreadsheetApp.getUi();
// Or DocumentApp or FormApp.
ui.createMenu('Custom Menu')
.addItem('First item', 'menuItem1')
.addSeparator()
.addSubMenu(ui.createMenu('Sub-menu')
.addItem('Second item', 'menuItem2'))
.addToUi();
} //end onOpen() function//
function menuItem1() {
SpreadsheetApp.getUi() // Or DocumentApp or FormApp.
.alert('You clicked the first menu item!');
} //end menuItem1() function//
function menuItem2() {
SpreadsheetApp.getUi() // Or DocumentApp or FormApp.
.alert('You clicked the second menu item!');
} //end menuItem2() function//
Hi The script editor is not anymore existing under Tools menu of the google sheet...how can we add script editor to make a menu?
Thanks a lot
Hi, thanks for this interesting video. Is there a way to create a gui interface (perhaps using html code) and show it to the user to capture info and write that info into some sheets cell ?
Thank you
It it possible to add links to certain sheets or tabs within the same sheet) in the custom menu? I can't seem to figure this out :(
Hello! Can you help with this issue? To create dynamic menu (items) from google sheets rows by using apps script. For example, when a range of rows is changed so the menu items are changed as well. Thank you.
thank You !!!
How do you add those icons that appear on the function's caption
Having serious problems adding a custom menu. Have tried multiple ways then tried yours and it still is failing at some point with no indication of where. If you or any one in the comments is willing to help, I'd love the help.
Hey LGS, is there a way to simply open an already existing menu item using Action Script?
Since there is no need to declare a variable for a menu anymore, are you thinking about revisiting the subject and creating a new video sometime? I've been trying to create a menu with some submenus and I've been having difficulties, mainly because I can't copy your code anymore :( Thanks
Nothing changed in the way the code works. I've just made one yesterday.
"How to add an icon" to menus will be nice as well :)
Hi there! If my function its parameter how could I put it into addItem :( ?
Have got an Error:
Error
Exception: Cannot call SpreadsheetApp.getUi() from this context.
function initMenu() {
var udi = SpreadsheetApp.getUi();
var menu = udi.createMenu("Classes");
menu.addItem("7A-7b", "sevenA");
menu.addToUi;
}
function onOpen(){
initMenu();
}
function sevenA() {
SpreadsheetApp.getActiveSpreadsheet().getActiveSheet().getRange("a1").setValue(new Date())
}
I tried to follow the syntax of your code, but the new menu doesn't come out, is there any wrong with my code?
menu.addToUi;
pls help im getting an error that says "TypeError: Cannot read property 'getActiveSheet' of null (line 3 file "Code")"
Edit wait nvm i just needed to rewatch the tutorial
Hi sir, hello followers, i found an issue by the onOpen event. If you declare GLOBAL variables that, in my case, refer to another spreadsheet, the event onOpen doesn't build your custom menu.
Your script will still work and your custom menu will be built if you run the script from the script editor.
Solution:
1) Avoid GLOBAL variables in your script file.
2) Build the men running the script from the script editor (make less sense).
3) Create an Textbox or Image in the sheet and assign it the script that build the menu, in this case make also no sense to call the script onOpen.
Did someone had the same issue like me?
Hope this was helpful
Have a nice day
can we create custom menu of a sheet with other sheets' appscript?
i have 2 sheets but i need a custom menu in the other sheet
I want to make a form of website to login as admin, or login as staff.
-Admin can edit staff.
-After logining: Multiple staffs can edit, view, update in the same time in the page like google sheet.
-After staffs access and edit, data auto saved in files and we can print it normally.
So what series can figure it? Need someone helps
Its so easy.
Could you please make more tutorial videos about App Scripts
Look it ruclips.net/p/PLlHR3f8sb05B9n0jnXgS3yxn2CTQ3XOGS
Is there any way to put a checkmark in front of a menu item to indicate that it's been clicked?
No.
@@ExcelGoogleSheets Thanks for the reply :). What would you recommend for handling the UI of time-based triggers then? I'm coding a menu item that when clicked, will trigger a time-based triggers. This seems suboptimal because I can accidentally click it a second, or third time, and end up with a lot of unwanted triggers.
@@barefacedquestions Open a sidebar and have your clickable buttons in the sidebar, where you can control their behavior.
Do things up date that quick? New sheet. New script. Copy exactly what you do and get ReferenceError: date is not defined (line 3, file "code"). Also what cannot call spreadsheet from this Ui even mean? If the spreadsheet is open in te next tab then surely te ActiveSheet should mean that.
UI means user interface. Everything is case sensitive, so Date NOT date
i'm getting the same problem, how do i solve the reference error. I tried both "date" and "Date"
Google changed the " to '. Had a problem with it at first.
Can you add UI and have certain shared users who only have read access to be able to edit certain cells in a UI created by a script? I am really lazy to do a whole python app for this please someone say yes.
If you needs a truly secure system use something with user authentication built in, like python django.
@@ExcelGoogleSheets I was worrying about that. once i go down that path it ia going to be crazy as it has to be multitenant as well. Ok thanks
// thank you
function initMenu(){
//This is where we acces the UI
var ui = SpreadsheetApp.getUi();
//create our main menu
var menu = ui.createMenu("My Macros");
//add regular items to our main menu
menu.addItem("My Time Macro", "myMacro");
menu.addItem("Another One", "myMacro");
menu.addSeparator();
menu.addItem("Third One", "myMacro");
menu.addSeparator();
//create a submenu ad add it to our main menu
var submenu = ui.createMenu("Special Functions");
submenu.addItem("Show The Box", "showMessage");
submenu.addItem("Same Date Function", "myMacro");
menu.addSubMenu(submenu);
//create another submenu ad add it to our main menu
var submenu2 = ui.createMenu("Special Functions");
submenu2.addItem("Show The Box", "showMessage");
submenu2.addItem("Same Date Function", "myMacro");
menu.addSubMenu(submenu2);
//render all of the above
menu.addToUi();
}
function onOpen(){
initMenu();
}
function myMacro() {
SpreadsheetApp.getActiveSpreadsheet().getActiveSheet().getRange("a1").setValue(new Date());
}
function showMessage(){
SpreadsheetApp.getUi().prompt("You did it!");
}
Finally someone with a brain!
Please, create complete manu
Does not work.
main manu
thank You !!!