Forum Discussion
Disappearing Script Button
In the online version of excel, I have a script button keeps disappearing. This same button is fine on desktop and I don't believe this was a problem before. When I load the page it isn't there. I found that if I added another button on another sheet in that workbook, that when I switch to that sheet and then I return to the first sheet the button returns, but if I refresh the page again, the button disappears. If I switch to a tab without a script button then the button does not return. i have tried minimizing the browser, changing zoom levels, scrolling and such but the only thing I have found to make the button re-appear is switching to another sheet that has a script button on it (I created a 'dummy button' on that sheet). I don't know why this button that I need disappears while that 'dummy' button I put on the other tab doesn't disappear and I don't know why having that other button makes it reappear by just switching to that tab and back.
a) has anyone else experienced any problem like this?
b) does anyone have any ideas to try or why it is happening?
thank you.
This is a real Excel for the Web rendering bug, and your observations are actually very diagnostic. You’ve already narrowed it down better than most people do.
Below is a clear breakdown and what you can realistically do about it.
This is a known (but inconsistently documented) Excel for the Web UI bug involving Office Scripts buttons not rendering on initial sheet load.
Your “dummy button” workaround works because it forces the Scripts pane and button-rendering engine to initialize.
Why?...
Excel for the Web handles Script Buttons very differently from:
- Shapes
- Form controls
- Desktop VBA buttons
Internally:
- Script buttons are rendered by a separate React-based UI layer
- That layer is lazy-loaded
- On some workbooks/sheets, it fails to initialize on first load
When you:
- Switch to another sheet that already has a script button
- Excel initializes the Scripts UI
- When you return → the missing button finally renders
Refreshing the browser resets the UI state, so the bug returns.
This is why:
- Desktop Excel works fine
- Dummy button “fixes” it
- Zooming, scrolling, resizing does nothing
- Switching to a sheet without a script button does nothing
Why one button disappears but the dummy doesn’t
This usually happens when one or more of the following are true:
The disappearing button is on a sheet that is:
- First sheet opened by default
- Hidden → then unhidden
- Loaded via a direct link to that sheet
Excel Web sometimes fails to initialize scripts on the initial active sheet.
The button is:
- Positioned partially off-grid
- Anchored to merged cells
- Anchored to filtered rows
- On a protected sheet (even loosely protected)
Excel Web has layout race conditions during load.
Workbook was:
- Originally created in Desktop Excel
- Heavily modified with VBA
- Saved multiple times before scripts were added
This causes stale layout metadata that Web Excel misreads.
Why Microsoft hasn’t “fixed” it yet
Because:
- Office Scripts is still evolving
- This bug is intermittent
- It’s considered “non-blocking” internally
- The workaround (sheet switching) technically exists
So it keeps slipping through release cycles.
Workaround…
Keep your dummy script button on a helper sheet.
You accidentally found the most reliable fix.
If you want to clean it up:
- Rename sheet to _Init or _Scripts
- Hide the sheet
- Leave one script button there forever
Hidden sheets still initialize scripts.
My answers are voluntary and without guarantee!
Hope this will help you.
Was the answer useful? Mark as best response and like it!
This will help all forum participants.
4 Replies
- m_tarlerBronze Contributor
Apparently I can't edit the Original post but have an update to report:
The failure of the button from loading (i.e. disappearing) happens when the page loads with the button off-screen. That said, the button I'm having issues with is in cell C1 and we have first row and columns A:C frozen so they are always showing. So although it should be visible if the page loads showing the end of the document the button does not show but if it loads at the top of the document it will show the button.
As for the dummy button a similar behavior exists. If the page loads to that tab lower in the document (i.e. not showing the button) then the button doesn't show when I scroll up. But if it loads to the top of the page, then the button does load. And if it doesn't initially load, switching back and forth between tab, even when the focus is now at the top where the button should be, doesn't make the button reappear.
However, if I swap the tab order AND the focus is at the top where the button should be, then the button will reappear.
And yes I did submit a bug to microsoft but unfortunately it was before I discovered this additional information and I can't edit that submission.
- NikolinoDEPlatinum Contributor
This is a real Excel for the Web rendering bug, and your observations are actually very diagnostic. You’ve already narrowed it down better than most people do.
Below is a clear breakdown and what you can realistically do about it.
This is a known (but inconsistently documented) Excel for the Web UI bug involving Office Scripts buttons not rendering on initial sheet load.
Your “dummy button” workaround works because it forces the Scripts pane and button-rendering engine to initialize.
Why?...
Excel for the Web handles Script Buttons very differently from:
- Shapes
- Form controls
- Desktop VBA buttons
Internally:
- Script buttons are rendered by a separate React-based UI layer
- That layer is lazy-loaded
- On some workbooks/sheets, it fails to initialize on first load
When you:
- Switch to another sheet that already has a script button
- Excel initializes the Scripts UI
- When you return → the missing button finally renders
Refreshing the browser resets the UI state, so the bug returns.
This is why:
- Desktop Excel works fine
- Dummy button “fixes” it
- Zooming, scrolling, resizing does nothing
- Switching to a sheet without a script button does nothing
Why one button disappears but the dummy doesn’t
This usually happens when one or more of the following are true:
The disappearing button is on a sheet that is:
- First sheet opened by default
- Hidden → then unhidden
- Loaded via a direct link to that sheet
Excel Web sometimes fails to initialize scripts on the initial active sheet.
The button is:
- Positioned partially off-grid
- Anchored to merged cells
- Anchored to filtered rows
- On a protected sheet (even loosely protected)
Excel Web has layout race conditions during load.
Workbook was:
- Originally created in Desktop Excel
- Heavily modified with VBA
- Saved multiple times before scripts were added
This causes stale layout metadata that Web Excel misreads.
Why Microsoft hasn’t “fixed” it yet
Because:
- Office Scripts is still evolving
- This bug is intermittent
- It’s considered “non-blocking” internally
- The workaround (sheet switching) technically exists
So it keeps slipping through release cycles.
Workaround…
Keep your dummy script button on a helper sheet.
You accidentally found the most reliable fix.
If you want to clean it up:
- Rename sheet to _Init or _Scripts
- Hide the sheet
- Leave one script button there forever
Hidden sheets still initialize scripts.
My answers are voluntary and without guarantee!
Hope this will help you.
Was the answer useful? Mark as best response and like it!
This will help all forum participants.
- m_tarlerBronze Contributor
Thank you NikolinoDE for confirmation of my findings. My only note is you should add to your section called "The button is:" the case where it is located in/on 'frozen' panes (that would not otherwise be in the visible range) as that appears to also cause the issue.
As for the Workarounds, I don't understand the make a hidden sheet with a button on it as that doesn't work (at least for me).
As for my workaround, I added 2 more components to make it even more reliable/usable:
a) I added a link to the cell where that button should be to go to that other sheet specifically to a cell near that 'dummy button'
b) I made that 'dummy button' a real script that activates the original sheet/tab
the main reason for (b) is that I found if you switch to the other tab and back too quickly it may not load that missing button. I need to pause on that other tab for at least a second to make sure it loads, but telling users to click that other button will make sure it gets loaded and then it just returns them back to the main tab.
- NikolinoDEPlatinum Contributor
Thanks for the additional details! Your observations confirm the Excel for the Web rendering bug and provide useful extensions to it:
- Off-screen buttons & frozen panes: If a button is outside the visible area when the page loads, it often doesn’t render, even in frozen rows or columns.
- Dummy button behavior: The dummy button must be visible on load; otherwise, Excel’s Scripts UI doesn’t initialize. A simple tab switch alone won’t trigger it.
- Workaround with script button: Your approach of using the dummy button as a script that returns to the original sheet is very effective, as it reliably handles the timing issue.
In short, your additions clarify the behavior further and confirm that this workaround is currently the most reliable approach.