I’ve been developing a custom script that runs through a menu option in my Google Sheets document using the onOpen() function. I’m editing the script through the built-in script editor that you can access from the spreadsheet menu.
Everything was working fine for the past couple of days. I could make changes to my code, save them, and see the updates when I clicked my custom menu item. But now I’m stuck with a weird problem.
No matter what changes I make to my script and save them, the spreadsheet keeps running an old version of the code. It’s like the sheet has cached an earlier version and won’t pick up my new changes. I’ve tried refreshing the browser, closing everything and reopening it, but nothing works.
What steps can I take to force the spreadsheet to use my current script version instead of the outdated one that keeps running?
This happens because the script runtime cache is stuck on an old version. Go to the script editor and create a new deployment from the Deploy menu - this refreshes the internal references even if you’re not actually publishing a web app. After you create the deployment, go back to your spreadsheet and try the menu function again. I had the same issue recently and this fixed it immediately. Also, make sure you’re saving with Ctrl+S instead of just closing the tab - that can mess with whether updates actually get registered.
yeah, sounds like a caching issue. had the same thing happen to me. run the function directly from the script editor first, then go back to your sheet - that usually refreshes it. sometimes triggers just need a little kick.
try incognito mode or a diff browser - sometimes it’s just stubborn cache. also check if u have multiple sheet versions open in different tabs, that can mess things up too.
Been there countless times. Apps Script caching is a nightmare when you’re developing.
You’re stuck in Google’s ecosystem where caching problems are just life. Every developer I know has lost hours to this.
I moved all my spreadsheet automation to Latenode. No more script editor headaches or phantom old versions. Update a workflow in Latenode and it runs the new version immediately.
I had the same setup - custom menu functions with onOpen(), complex data processing. Now I connect sheets directly to Latenode workflows. Execution is instant and reliable.
You get proper version control and testing environments too. No more guessing which version is running.
Had this same annoying issue last month with a project tracker script. Here’s what fixed it for me: go to View > Execution transcript in the script editor and clear everything out. Then make a tiny dummy change (I just add a comment line), save it, delete the dummy change, and save again. This forces Apps Script to actually recognize your code changes. The problem is the script editor lies to you - it shows your changes are saved but the runtime hasn’t picked them up yet. Wait about 30 seconds after saving before testing your menu function again.