Microsoft Office Tutorials and References
In Depth Information
Notice the Local Path box. This is where the root of your Web server is located. By default, the
path is C:\inetpub\wwwroot. Any Web pages placed in this directory are published at the
following URL: http://localhost/PageName.html .
Saving Worksheets as Web Pages
To help save time and effort, it’s best if a template is created for updating the latest
information to your Web site. The template provides the easiest way to present your results on a Web
page. The template workbook contains all the formatting and links that are required. When
your application produces its results, it’s a simple task to copy the relevant numbers into the
template, and then save the template directly to the Web server.
The following example uses a template file to post the new results directly to the Web server:
Tip Customize the Procedure
The following procedure will need to be customized using a folder you have created on your
computer. Keep in mind that to run this procedure you’ll need to modify filenames, range
references, references to charts, and PivotTables.
Sub PublishResultsToWeb()
Dim webBk As Workbook
Dim webSht As Worksheet
Set webBk = Workbooks.Add(“C:\WebTemplate.xls”)
Set webSht = webBk.Worksheets(1)
webSht.Range(“Profits”).Value = Workbooks(“Results.xls”) _
.Worksheets(“Financials”).Range(“Profits”).Value
webSht.SaveAs “http://localhost/resultsjuly2001.htm", xlHtml
webBk.Close False
End Sub
Adding Interactivity with the Web Components
The previous example saved a static rendition of the worksheet in HTML format to the Web
server. However, Office Web Components can create interactive Web pages. When saving a
worksheet in interactive form, several conversions occur:
Worksheet or ranges on the sheet are converted to Spreadsheet Web Components
Selected Charts are converted to Chart Web Components
PivotTables are converted to PivotTable Web Components
These components are ActiveX controls that are embedded in the HTML page, designed to
provide similar interaction as in Excel but from the browser.
Search JabSto ::




Custom Search