You can save an entire workbook, including tabs for navigating worksheets, or portions of a workbook, such as a range or chart, to a static Web page so that users can view your Microsoft Office Excel data on the World Wide Web. For example, if you have sales figures on an Excel worksheet, you can save the figures along with a chart to compare those figures, and users can view the information without having to open Office Excel.
What do you want to do?
Learn more about saving Excel data to a static Web page
When you save Excel data to a static Web page, it is important to understand the AutoRepublish feature, where supporting files are located, how to define hyperlinks, and the differences between reopening a saved Web page instead of reopening the original workbook.
Using the AutoRepublish feature
Each time that you save your workbook, you can automatically republish it to the Web by selecting the AutoRepublish every time this workbook is saved box in the Publish as Web Page dialog box. (On the File tab (Microsoft Office Button in Excel 2007), click Save As, select a Web page format (.htm, .html, .mht, .mhtml), and then click Publish.)
However, there may be times when you don't want to automatically republish items in your workbook, for example, when you:
-
Have entered confidential or sensitive information that should not be saved to a public location
-
Are temporarily disconnected from a network or Web server location
-
Are saving a workbook that was created by someone who is not a trusted source (The workbook could contain macros that collect information from a network location by using your credentials, and then save that information to a public location.)
If necessary, you can make AutoRepublish temporarily unavailable (for the current open and close session) or permanently unavailable (every time that you open, save, and close).
About supporting Web files and hyperlinks
Web pages often contain images and other supporting files as well as hyperlinks to other Web pages. When supporting files or pages are moved, the Web page that refers to them may no longer work properly.
Supporting files
When you save an Excel workbook or worksheet as a Web page (.htm, .html), Excel creates a supporting folder named "filename_ files" where it saves all of the page's supporting files — such as bullets, background textures, and graphics. For example, if your file is named Page1.htm, Excel creates a subfolder named "Page1_ files." Excel also assigns names, such as image001.jpg and image002.gif, to the supporting files.
If you move or copy your Web page to another location, you must also move the supporting folder so that you maintain all links to your Web page. When you resave to another location, Excel automatically copies the supporting folder for you.
For example, suppose you have a Web page: http://example.microsoft.com/Page1.htm. It includes bullets, which are stored in a supporting folder: http://example.microsoft.com/Page1_ files. The relative paths for the bullet files are /Page1_ files/image001.gif and /Page1_ files/image002.gif. If you move Page1.htm to a new location, such as http://example.microsoft.com/, you must also move the supporting files folder (Page1_ files) to http://example.microsoft.com/.
Relative and absolute hyperlinks
When you create Web pages, Excel automatically manages the related files and hyperlinks so that the images appear and the links work when the pages are placed on the final Web server.
When all the files — such as bullets, navigational buttons, background textures, graphics, and Web pages that you create hyperlinks to — are placed on, or saved to, the same Web server, Excel maintains the links as relative links.
Hyperlinks to Web sites on other servers — for example, a list of your favorite places on the Web — are maintained as absolute links — that is, fixed file locations.
When you save your Web pages to a different location, links that can't be converted to relative links remain as absolute links.
When you delete elements that were saved as relative links, Excel automatically deletes the corresponding supporting files from the supporting folder.
Language-specific names for Web page supporting files
A suffix appears in the language of the version of Microsoft Office System that was used to save the file as a Web page. For example, suppose that you use the Dutch language version of Microsoft Office System to save a file named Page1 as a Web page. The default name of the supporting folder would be Page1_bestanden. The following section contains a complete list of languages and default folder names.
Languages and default folder names
Language | Default supporting folder name |
---|---|
Arabic | .files |
Basque | _fitxategiak |
Brazilian | _arquivos |
Bulgarian | .files |
Catalan | _fitxers |
Chinese (Simplified) | .files |
Chinese (Traditional) | .files |
Croatian | _datoteke |
Czech | _soubory |
Danish | -filer |
Dutch | _bestanden |
English | _files |
Estonian | _failid |
Finnish | _tiedostot |
French | _fichiers |
German | -Dateien |
Greek | .files |
Hebrew | .files |
Hindi | .files |
Hungarian | _elemei |
Italian | -file |
Japanese | .files |
Korean | .files |
Latvian | _fails |
Lithuanian | _bylos |
Norwegian | -filer |
Polish | _pliki |
Portuguese | _ficheiros |
Romanian | .files |
Russian | .files |
Serbian (Cyrillic) | .files |
Serbian (Latin) | _fajlovi |
Slovakian | .files |
Slovenian | _datoteke |
Spanish | _archivos |
Swedish | -filer |
Thai | .files |
Turkish | _dosyalar |
Ukrainian | .files |
Vietnamese | .files |
Note: If you save your Web page with a short file name (maximum of eight characters, plus a three-character file extension) by clearing the Use long file names whenever possible check box in the Web Options dialog box, the supporting folder is the name of the Web page without the word "files."
Reopening a saved Web page in Excel
When you save an Excel workbook as a Web page, you can open the resulting Web page file in Excel, make changes, and save the file. However, fewer Excel features are maintained in the file, and you may not be able to modify them as you could originally. For instance, when you save a chart as a Web page, the chart becomes a separate image and can no longer be modified on the page. However, when you save an entire workbook that has a chart in it, the actual chart is saved rather than just an image, and the chart can be modified when you reopen the file.
For best results, Microsoft recommends that you use the original workbook (*.xlsx) as your "master" copy that you open, make changes, save as a workbook, and then save as a Web page.
Save Excel data to a static Web page
-
On the File tab (Microsoft Office Button in Excel 2007), click Save As.
The Save As dialog box is displayed.
-
In the list box, do one of the following:
-
To save to a Web page and create supporting files and folders, select Web Page (*.htm; *.html).
-
To save to a Single File Web page with supporting files embedded in the Web page, select Single File Web Page (*.mht; *.mhl)
-
-
If you already selected the item that you want to save, click Save, and you are finished. Otherwise, continue with the following steps.
-
Do one of the following:
-
To save the entire workbook, including tabs for navigating each worksheet in the workbook, click Entire Workbook.
-
To save the current selection on the worksheet, click Selection: Sheet.
-
-
Click Publish.
The Publish As Web Page dialog box is displayed.
-
Under Item to publish in the Choose box, select one of the following:
Item | Action |
---|---|
Entire workbook | Select Entire workbook. The entire workbook is saved, including tabs that a user can use to navigate to each worksheet. |
Entire worksheet | Select Items on Sheetname, and then select All contents of Sheetname. |
Items | Select Items on Sheetname, and then select the item that you want to save, such as a PivotTable report or a chart. Items do not include ranges of cells. |
Ranges of cells | Select Range of cells and then, if the selection box does not contain the range that you want, click the worksheet (the dialog box will collapse to a selection box), select a range of cells from the Excel workbook, and then click Expand Dialog . |
Charts | Select Items on Sheetname, and then select Chart x. |
Filtered ranges | Select Items on Sheetname, and then select the AutoFilter item that you want to save. |
External data ranges | Select Items on Sheetname, and then select the Query item that you want to save. |
Republishing | To republish a worksheet or item that you have already published, select Previously published items and then select the worksheet or item that you want to republish. To prevent an item from being republished, select the item and click Remove. To continue publishing, click another item in the list. |
-
To add a title that is centered over the selection and in the title bar of the browser, click Change under Publish as. Type the title that you want, and then click OK.
-
Next to the File name box, click Browse, and locate the drive, folder, Web folder, Web server, HTTP site, or FTP location where you want to save your Web page, and then click OK.
You can also choose an existing Web page to append to or replace as long as you have permission to modify the Web page and have access to the file.
Tip: When you first create your Web page, it is a good idea to save the Web page on your local hard drive so that you can make any changes or corrections that you need to before you publish the Web page on a public or shared location.
-
To view the Web page in your browser after you save it, select the Open published Web page in browser check box.
Note: To preview the page without saving it you can use the Web Page Preview command, which you can add to the Quick Access Toolbar.
-
If you expect to make changes in the workbook later and want to automatically republish the items each time that the workbook is saved, select the AutoRepublish every time this workbook is saved check box.
-
To change additional related options, do one or more of the following:
-
To change Web page options, click the arrow next to Tools, and then click Web Options. For more information, see Web Page options.
-
To change picture compression options, click the arrow next to Tools, and then click Compress Pictures. For more information, see Reduce the file size of a picture.
-
-
Click Publish.
-
If you are saving to an existing Web page, a message appears. Do one of the following:
-
To copy over the existing page, click Replace file.
-
To append your data to the end of the Web page, click Add to file.
-
Enable AutoRepublish or make AutoRepublish unavailable
If you have enabled the AutoRepublish feature, a message appears each time that you save the workbook. You can make AutoRepublish temporarily or permanently unavailable, or you can keep it. You can also control how the message is displayed.
Note: You can tell that a workbook is set to AutoRepublish when you see Publishing to Page: filename in the status bar when you save the workbook.
Make AutoRepublish temporarily unavailable
When the message appears, do the following:
-
Select the Disable the AutoRepublish feature while this workbook is open option.
-
Click OK.
AutoRepublish is not available for the current session of the workbook only, or until you close the workbook. The next time that you open the workbook, AutoRepublish will be enabled.
Disable AutoRepublish permanently
-
Open the workbook that is set to automatically republish.
-
On the File tab (Microsoft Office Button in Excel 2007), click Save As, select a Web page format (.htm, .html, .mht, .mhtml), and then click Publish.
-
In the Choose list, click Previously published items.
-
Select the item that you want to discontinue republishing automatically, and click Remove. Repeat for each item that you don't want to automatically republish.
-
Click Close.
-
To save the change to your workbook, on the File tab (Microsoft Office Button in Excel 2007), click Save.
Continue with AutoRepublish
When the message appears, do the following:
-
Click Enable the AutoRepublish feature in the message that is displayed each time that you save the workbook.
Control display of the AutoRepublish message
If you don't want the message to appear every time that you save the workbook, you can select the Do not show this message again check box. Be aware, however, that this setting then applies to all Excel workbooks that are set to AutoRepublish.
AutoRepublish errors and warnings
You may receive the following error or warning messages when you use the AutoRepublish feature.
WARNING: External references converted to values in <file name/path>
The workbook you are republishing contains references to other workbooks, pages, or documents, such as a link from Book1.xls that gets the value in cell A1 of Book2.xls. Because external references are not supported in the resulting published Web page, the reference is converted to the last retrieved value on the Web page. The reference in the workbook, however, remains intact.
WARNING: Hidden formulas no longer protected in <file name/path>
Hidden formulas become visible on published Web pages. If you don't want hidden formulas to be shown on the Web page, remove them before saving and republishing.
WARNING: Precision as displayed option not supported in <file name/path>
This workbook uses the Precision as displayed option, which is available under the Calculation options section on the Formulas category in the Excel Options dialog box (On the File tab (Microsoft Office Button in Excel 2007), click Excel Options). This means that stored values in cells are no longer precise to 15 digits, but are precise to the displayed value in the cell. Because Precision as displayed is not supported on Web pages, results of formulas or values you enter or change on the Web page published from this workbook will no longer have the Precision as displayed option applied to them.
WARNING: 1904 date system converted to 1900 date system in <file name/path>
This workbook uses the 1904 date system, an option available under the When calculating this workbook section on the Advanced category in the Excel Options dialog box (On the File tab (Microsoft Office Button in Excel 2007), click Excel Options). Generally used for Macintosh compatibility, this option changes the starting date from which all dates are calculated in Microsoft Excel from January 1, 1900, to January 2, 1904. Because Web pages do not support the 1904 date system, your dates will be converted to the 1900 date system on the Web page, and may show a difference of approximately four years.
ERROR: Cannot access <file name/path>
The items you are republishing cannot be saved to the location where they were previously published.
-
Check if the Web site or server to which you are publishing is functioning properly.
-
Check if the location to which you previously published has changed names or moved.
-
Make sure you have proper permissions to the location to which your items were previously published.
ERROR: There is protected data in <file name/path>
Protected data cannot be saved in a Web page. To republish the workbook, you must first unprotect the data and remove all passwords. If necessary, you should move confidential or sensitive information into a workbook that you are not publishing.
ERROR: This file is not in the proper format <file name/path>
You cannot use the AutoRepublish feature to publish Microsoft Excel data to a file that is not in a Web page format (.htm, .html, .mht, mhtml). Make sure you are publishing to a page that is in an HTML format.
ERROR: Previously published data has been deleted from <file name/path>
Items in the workbook set to AutoRepublish no longer exist.
ERROR: There is not enough memory to publish <file name/path>
-
Close any unnecessary programs or windows on your desktop to recapture available memory on your system.
-
Check the amount of disk space available at the location to which you are trying to publish and make sure there is enough available for your Web page.
-
Check to make sure that you have not exceeded the limits of your assigned space at the location to which you are publishing.
-
Try reducing the file size of the workbook by removing sheets, objects, or any unnecessary items.
-
Check the amount of disk space on your computer. Delete unnecessary files from your hard disk.
-
Check the random access memory (RAM) on your system and make sure it is working properly and that you have the recommended amount for your version of Microsoft Office or Office Excel.
Change the title of the web page when you save
The title of your web page appears in the browser toolbar, provides a title for the page when it is added to favorites, and displays a title for the page in search-engine results. It is important for SEO to use a title that accurately reflects what the page contains, and is not too short or too long.
-
Click File > Save As > Browse.
-
In the Save As dialog, select Single File Web Page.
-
Click Change Title, and then in the Enter Text dialog box, type the title you want, then click OK.
Issues with saving to a Web page
When you save a workbook to a Web page, you may encounter the following issues:
Issue: I don't see conditional formats
Conditional formatting is not supported with Single File Web Page (.mht, .mhtml) pages; use the Web Page (.htm, .html) file format instead. Data bars, color scales, and icon sets are not supported in either format.
Issue: Text in a cell is cut off when I save data as a Web page
If you notice that text in a cell is truncated or not completely displayed, try the following:
Modify cells that contain automatically wrapped text You might have formatted cells with wrapped text before you saved the data as a Web page. To prevent text from being cut off when you save it, you can shorten the text, use multiple cells for text, or widen the column in your worksheet, and then save the data.
Widen the column the text is in Where text in a cell overlaps another cell, the overlapping portion may not be saved. Widen the column the text is in so that it does not overlap other cells.
Realign the text If you see text that is cut off in a cell, the text was longer than the length of the cell when it was saved, and it was right-aligned or center-aligned. Edit the original workbook and realign the text as left (indent).
Issue: Rotated text doesn't appear correctly when I save data as a Web page
You can't use rotated or vertical text when you save Excel data as a Web page. Rotated and vertical text are converted to horizontal text.
Issue: Items I save to an existing Web page always appear at the bottom of the page
When you save Excel data to an existing Web page, Excel always appends the data to the bottom of the page.
To move the Excel data to another position on the Web page, you can open the Web page in a design program, such as Microsoft Office SharePoint Designer, and rearrange the items.
Issue: I moved my Web page to another location, and now some of the links are broken
When you save a Web page, Excel by default saves all supporting files — such as bullets, background textures, and graphics — in a supporting subfolder. If you move or copy your Web page to another location, you must also move the supporting folder so that you maintain all of the links to your supporting files.
Issue: I see a red X on my Web page
A red X indicates a missing graphic. If you move or copy your Web page to a new location without moving the supporting files, the links to graphics — such as photos, bullets, and background textures — may be broken.
No comments:
Post a Comment