Others

Stop a Web Page from Scrolling to an Embedded Excel Sheet on Refresh

Camila MilosovichCamila Milosovich Dec 2, 2026 868 views

Question details

Find out why a web page scrolls to an embedded Excel sheet after refresh and how to prevent it.

Stop a Web Page from Scrolling to an Embedded Excel Sheet on Refresh
Product
Microsoft Excel embedded spreadsheet
Device & OS
not provided
Scenario
A user refreshes a web page containing an embedded Excel spreadsheet.
Observed behavior
The browser scrolls to the spreadsheet, possibly because the embedded frame or a previously active cell receives focus.
Before you start

Open the affected page and note whether the URL contains a fragment after a # symbol. If you manage the page, have access to its embed code and browser developer tools.

Solution 1Recommended

Check Whether the Excel Embed Receives Focus on Refresh

Use this approach when the browser appears to jump to the spreadsheet because the embedded frame becomes active.

1
Inspect the active element

Open the page in your browser, open Developer Tools, and run document.activeElement in the Console after the page loads. Check whether the result is the spreadsheet iframe.

2
Review the embed and scripts

In Developer Tools, inspect the iframe and search the page's source files for autofocus, focus(), and scrollIntoView(). Look for code that focuses the iframe or scrolls it into view during loading.

3
Remove unintended focus

In the page source, remove or revise any automatic focus or scrolling that targets the spreadsheet unnecessarily. Keep intentional keyboard-accessible focus behavior.

4
Reload and test

Save the page changes, refresh the page, and check whether it still jumps to the spreadsheet. Also test keyboard navigation to confirm the embed remains usable.

Check Whether the Excel Embed Receives Focus on Refresh
The cause may be outside Excel: The browser may restore a previous focus or scroll position, or page scripts may move the view. If the iframe is hosted on another domain, the browser may restrict inspection of its internal content.
Free Microsoft Office alternative

Work with Excel Spreadsheets in WPS Office

WPS Office is a free, lightweight Office alternative with a familiar interface for opening and editing spreadsheets. Its Microsoft Office format support helps you move existing files into WPS; it does not fix scrolling on a website that embeds Excel.

Open and edit spreadsheet data in WPS SpreadsheetsSupports Microsoft Excel formats such as XLSX and XLSFamiliar interface makes it easier to move from Microsoft OfficeFree, lightweight suite for everyday document work
microsoft office alternative - wps office

Frequently Asked Questions

Why does the page jump to the embedded Excel sheet after refresh?

The iframe may receive focus, or the browser may restore a previous scroll position. A URL fragment or page script can also move the page to the spreadsheet.

How can I tell if the spreadsheet iframe has focus?

After the page loads, open Developer Tools and enter document.activeElement in the Console. If it returns the spreadsheet iframe, the frame is the active element in the parent page.

Will disabling scroll restoration stop every jump to the sheet?

No. Setting history.scrollRestoration to 'manual' can stop automatic browser scroll restoration, but focus changes, URL fragments, and scripts can still move the page.

What if I cannot edit the website's code?

Check whether removing a # fragment from the address bar changes the behavior. For a permanent fix, share the page URL and your findings with the website administrator, who can inspect the embed and scripts.