function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Want to display page in excel format similar to PDF

I have used below given code

<apex:page contentType="application/msWord">
  <!-- Begin Default Content REMOVE THIS -->
  This is your new Page
  <!-- End Default Content REMOVE THIS -->


When I view the page, open/save dialog box open to view the excel. I want to display the doc in browser itself like PDF files are displayed.


Any idea how to prevent this open/save dialog box and diaply excel inside the browser?


You have to use the "embed" or "object" tags in order to have it display in the browser inside a page. To make the page open as a full-browser-window "page", like PDF does, requires changing the brower's settings and the application's ability to be embedded, and is NOT affected by your Visualforce code. This can not be solved by coding Visualforce, and has to be answered at the application/operating system level.