Read-Only Office Viewer for Word, Excel and PowerPoint

An Easy Way to Embed Excel on a Web Page

Many people need to display Excel content on web page or allow an Excel report to be viewed embedded on a Web page. And at present the options for doing so are very limited. 

An Easy Way to Embed Excel in a Web Page is to use the Edraw office viewer component directly. The excel component allows the developers to embed Excel anywhere in a web application by simply inserting the html object and using the javascript or vbscript to interact the Excel.

Click Here to Download Office Component - Support Word, Excel, PowerPoint, Visio and Project

free download5 MB

embed excel

Office Viewer Component Online Demo

The following codes describe an approach to displaying Excel documents within a web page using officeviewer.cab file.

This is how you use the office viewer component to host ms Excel document.

<object classid="clsid:7677E74E-5831-4C9E-A2DD-9B1EF9DF2DB4" id="OA1" width="100%" height="100%" codebase="http://www.edrawsoft.com/download/officeviewer.cab#7,5,0,355">
<param name="Toolbars" value="-1">
<param name="BorderColor" value="15647136">
<param name="BorderStyle" value="2">
</object>

And this is how you display a excel document on the fly.

function OpenFromServer()
{
var sPath= window.prompt("Type the file url:", "http://www.ocxt.com/demo/samples/sample.xls");
document.all.OA1.Open(sPath, "Excel.Application");
}

The Excel component has some events to help developers load an excel file when the web page loads or set the component properties.

The following script is to hide the toolbar and grid when the component was initialized.

function EDOffice_NotifyCtrlReady()
{
document.all.EDOffice.BorderStyle = 1;
document.all.EDOffice.Toolbars = false;
}
<SCRIPT LANGUAGE=javascript FOR=EDOffice EVENT=NotifyCtrlReady>
<!--
EDOffice_NotifyCtrlReady();
//-->
</SCRIPT>

The Excel Component allows the developer to do the Excel automation.

function VBAProgramming()
{
if(document.OA1.IsOpened)
{
if(document.all.OA1.GetCurrentProgID() == "Excel.Application"){
var objExcel = document.OA1.GetApplication();
var worksheet = objExcel.ActiveSheet;
worksheet.cells(1,1).value ="100";
worksheet.cells(1,2).value ="101";
worksheet.cells(1,3).value ="102";
worksheet.cells(2,1).value ="103";
worksheet.cells(2,2).value ="104";
worksheet.cells(2,3).value ="105";
}
}
}

It's possible to use the above code in ASP, ASP.NET or PHP language, too. The component supports seamless integration with Excel 97, Excel 2000, Excel 2003, Excel 2007 and Excel 2010.

Embed MS Excel in VB 6 and Do the Excel Automation

Embedding Office Viewer Component in VB.NET and Do the Excel Automation

Embed MS Office in ASP.NET Program

Embedding MS Project

Embedding Visio

Embedded MS PowerPoint

Disables MS Word Standard Command

Disable Office Ribbon Button

Show/Hide Office Menu Bar

Free Download Office Viewer Component and View Sample Projects

Free Download Office Viewer Component

Copyright © EdrawSoft 2004 - 2014. All rights reserved.