Click here to Skip to main content
13,257,383 members (49,536 online)
Click here to Skip to main content
Add your own
alternative version


2 bookmarked
Posted 13 Apr 2011

Adding Persistent Excel Sheets to Your Web Page

, 13 Apr 2011
Rate this:
Please Sign up or sign in to vote.
How to add a persistent Excel sheet to your web page

Adding an Excel sheet to your web page can be done by simply adding an object with a particular classid to your page, as shown below:

<table > 
<tr style="height: 500px">
<object id="spreadsheet1" width="100%" height="100%" 

   classid="clsid:0002E559-0000-0000-C000-000000000046" viewastext>
<param name="MaxHeight" value="1000px" />
<param name="MaxWidth" value="1000px" />

This will only work on Internet Explorer, and you also need to have OWC (Office Web Component) installed on your computer. If you have Microsoft Office 2003 installed, you would already have OWC; otherwise, you can download it from here.

To make the Excel sheet persistent, you want access to its data so you can store it to the database. The object shown above is not an ASPX control that you can have access to in code-behind. The JavaScript code in your page, however, would have access to this data as:


You can use a Web Service to store or retrieve data. To access a Web Service from JavaScript, you have two options. One is using the component to bring Web Service behaviour to your web page as explained in About WebService Behavior. The other option is to use ASP.NET AJAX to access Web Services as outlined in Calling Web Services with ASP.NET AJAX.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Morris Bahrami
Australia Australia
I have over 17 years of experience in software development in a variety of fields. For last 7 years the emphasis has been mostly on .NET technology (C# and VB.NET) which includes WPF, WCF and ASP.NET AJAX. Also have SQL Server experience including SSIS and SSRS. My blog ( has a collection of tips and general info for Microsoft Developers.

You may also be interested in...


Comments and Discussions

-- There are no messages in this forum --
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.171114.1 | Last Updated 13 Apr 2011
Article Copyright 2011 by Morris Bahrami
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid