How to Control Zoom and Size of an Embedded OneDrive Excel File
Question details
The user needs to adjust the zoom and dimensions of an embedded OneDrive Excel workbook to fit within a website space without requiring horizontal and vertical scrolling.

- Product
- OneDrive / Microsoft Excel
- Device & OS
- not provided
- Scenario
- Embedding an Excel workbook into a website or blog using an iframe.
- Observed behavior
- The embedded Excel file does not fit the available website container, causing horizontal and vertical scrollbars to appear in the iframe.
Ensure you have edit access to the original Excel file on OneDrive and the ability to modify the HTML/CSS code of the website where the iframe is embedded.
Use OneDrive's Built-In Embed Settings
Generate a new, properly sized embed code directly from the OneDrive interface to ensure the Excel file fits your website layout perfectly.
OneDrive provides built-in tools to customize how a workbook appears when embedded on a webpage. Using these native settings is the most reliable way to prevent unwanted scrolling.
Log in to your OneDrive account through a web browser and locate the Excel workbook you want to embed.
Right-click the Excel file and select 'Embed' from the context menu, or open the file and navigate to File > Share > Embed.
In the Embed settings panel, modify the Width and Height pixel values. The live preview window will update automatically to show if scrollbars are still present.
Once the preview looks correct and displays without scrollbars, copy the generated HTML iframe code and paste it into your website's HTML editor.

Adjust Iframe Dimensions with Responsive CSS
Modify the iframe tag manually using CSS to ensure it scales responsively on all screen sizes and prevents horizontal scrolling.
Test with a Different Excel Workbook
Determine if the scrolling issue is caused by the iframe settings or the specific content formatting within the Excel file itself.
Looking for an Easier Way to Share Spreadsheets? Try WPS Office
If you're tired of complex iframe embed codes and website display issues with Microsoft Excel, WPS Office provides a seamless, lightweight, and free alternative. Create, edit, and share spreadsheets effortlessly with full Microsoft Office format compatibility.
- 1. Download WPS Office: Install the free WPS Office suite on your preferred device.
- 2. Open Your Spreadsheet: Launch WPS Spreadsheet and open your existing Excel workbook.
- 3. Share via Link: Click the 'Share' button to generate a secure, responsive viewing link via WPS Cloud, bypassing the need for complex iframe embedding.

Frequently Asked Questions
Why does my embedded Excel file still show scrollbars after resizing the iframe?
Scrollbars appear when the actual content of the Excel sheet (like wide columns or a large number of rows) exceeds the physical dimensions set in the iframe. You may need to adjust the column widths within the source Excel file itself to fit the embedded view.
Can I make the embedded OneDrive Excel file completely responsive for mobile users?
Yes. Instead of using fixed pixel values for width and height in the embed code, you can use CSS percentages (such as setting width='100%'). This allows the iframe to automatically adjust to the viewer's screen size on mobile devices.
Is there a way to hide the OneDrive toolbar and gridlines in the embedded view?
Yes. When generating the embed code in the OneDrive interface, you can select the options to 'Hide row and column headers' and 'Hide gridlines'. This creates a cleaner look and frees up valuable space inside the iframe, which can help reduce the need for scrolling.




