Поделиться через


Working with the Office Web Components

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

Microsoft Office 2000 applications support HTML code as a native file format, making all Office documents "Web-ready" by default. Publishing an Office document to the Web is now as easy as saving a file to your computer's hard disk.

However, publishing an Office document to the Web is only half the challenge. When you are working with worksheets or databases, much of the value of these documents is the ability to interact with the data they display. Allowing users to interact with the data in an Office document when it is viewed in a Web browser is a key aspect of publishing powerful and useful views of the data displayed by an Office document. Being able to interact with the data allows users to get the information that they think is important, not just the information that the document's publisher thinks is important.

Web browsers do not provide a way to sort, filter, change, or recalculate the data displayed in the browser. The Microsoft Office Web Components provide the means to let you publish Office documents to the Web while preserving the interactivity the documents have when they are viewed in their native applications. The Office Web Components are a collection of ActiveX controls designed to let you publish fully interactive worksheets, charts, PivotTable reports, and databases to the Web. When users view a Web page that contains an Office Web Component, they can interact with the data displayed in that document right in Internet Explorer. Users can sort, filter, add, or change data, expand and collapse detail views, work with PivotTable lists, and chart the results of their changes. In addition, the Office Web Components are fully programmable, which lets you create rich, interactive content for Web-based solutions.

****Important   ****The Office Web Components work only in Internet Explorer 4.01 or later. Office Web Components on Access data access pages work only in Internet Explorer 5 or later. In addition, you get the most complete functionality with all of the Office Web Component controls in Internet Explorer 5 or later. To view and work with any of the Office Web Components, users must either have Office 2000 installed, or if your company has an Office 2000 site license, they must download the Office Web Components from your corporate intranet.

The following table describes the Office Web Components and lists the ActiveX control and object that correspond to each component.

Office Web Component ActiveX control Object Description
Spreadsheet Component Spreadsheet Spreadsheet This component provides a recalculation engine, a full function library, and a simple worksheet user interface for use on Web pages.
Chart Component Chart ChartSpace This component displays a graphical representation of data from a Spreadsheet, PivotTable List, or Data Source control. When bound to other controls on a page, the Chart control updates instantly in response to changes made to the bound controls.
PivotTable Component PivotTable List PivotTable This component allows users to sort, group, filter, outline, and manipulate data from a worksheet, database, or multidimensional data cube.
(None) Data Source DataSourceControl This control manages communication between a Web page or controls on the page and the source of data for the page. This control provides the reporting engine behind data access pages as well as the PivotTable List control.

All of the Office Web Components expose an object model and are fully programmable by using VBA within an Office application or by using VBScript or JScript code in a Web page. In addition, since the Office Web Components are ActiveX controls, they can be used in any environment that supports ActiveX controls, including all the programming tools in Microsoft Visual Studio.

You can use the Object Browser to view the objects, methods, and properties associated with the Office Web Components. To display these items in the Object Browser, you must set a reference to the Microsoft Office Web Components 9.0 object library (Msowc.dll), which is in the C:\Program Files\Microsoft Office\Office folder.

You can insert an Office Web Component control in a Web page in several ways:

  • In Excel, you can use the Publish as Web Page feature to export Excel charts, worksheets, and PivotTable reports to a Web page.

    Note   Not only can you export data from Excel to an Office Web Component control on a Web page, but the Spreadsheet and PivotTable List controls also support exporting data from the control to Excel by clicking Export to Excel on the control's toolbar.

  • In Access, you can add an Office Web Component control to a data access page by clicking the Office Chart, Office Spreadsheet, or Office PivotTable tool in the toolbox and then clicking the place on the page where you want the control to appear.

  • In FrontPage, you can add a Chart, Spreadsheet,****or PivotTable List control to a FrontPage document by pointing to Component on the Insert menu, and then clicking Office Chart, Office Spreadsheet, or Office PivotTable.

  • In a Web page, you can insert an Office Web Component control by adding an <OBJECT> tag for the control to the page and then specifying the control's class identifier (CLSID) as the setting for the CLASSID attribute.

The CLSIDs for the Office Web Component controls and all the objects and related methods and properties for each control are documented in the Msowcvba.chm Help file, which is located in the C:\Program Files\Microsoft Office\Office\1033 subfolder.

Note   The path to the Msowcvba.chm Help file reflects the language ID folder (1033) for U.S. English language support in Office. The language ID folder below C:\Program Files\Microsoft Office\Office differs for each language.