One of our customers has created a pivot table in Excel. He wants us to publish this sheet on our intranet website. So by using OWC11, there is no license issues with roll out to a few members of his team. He wants them to see it as it is rather than copying the file to team members thus centralizing the data.

The pivot table contains drop downs with options of turning off columns etc.

This is simply going to be a read only page. No data is being added or modified. I could publish it using the file stream method but it is rather awkward thus I think the OWC 11 offers a smoother transition.

I adding a reference to OWC 11 for the project and kicked in the following command:

using Microsoft.Office.Interop.Owc11;

Next, on the page load:

string strConn2 = "Provider=Microsoft.Jet.OLEDB.4.0;" +

"Data Source=c:\\NET_AFISSummary\\AFISData.xls;" +

"Extended Properties=" + (char)34 + "Excel 8.0;HDR=Yes;" + (char)34;

if (Request.Browser.ActiveXControls)


Response.Write("<OBJECT id='pTable' style='Z-INDEX: 109; LEFT: 8px; WIDTH:502px; POSITION: absolute; TOP: 8px; HEIGHT: 217px' height='217' width='502'classid='clsid:0002E55a-0000-0000-C000-000000000046'VIEWASTEXT></OBJECT>");

//cause the object to load data on the client

Response.Write(@"<script>document.all.pTable.Conne ctionString ='" + strConn2 + "'</script>");

Response.Write("<script>document.all.pTable.Resour ceID = 'FundTable'</script>");


There is no objections of OWC not being registered but I suspect the problem lies with the connection string command. The name of the excel worksheet is 'FundTable' as indicated in ResourceID. The connection string is strConn2.

If anyone has any luck doing this in Excel on their projects, I'd be grateful.

The Pivot Table shows up but with the following error notes:

The query could not be processed: The "" object could not be found.

"" is truly blank. Not sure why. I'm using local host, meaning my c:\ drive for now.

There are also warnings of an 'unsafe' data provider but to proceed if I think it's okay. Wonder how to suppress that, too.