The documents that you open in the web applications for Word, PowerPoint and Excel are the same as the documents you open in their desktop applications, but some features work differently in the two environments. The web applications let you make basic editing and formatting changes. For more advanced features you need to open the documents in their desktop applications.
One of the more annoying thing with Word’s web application is that it, by default, does not display the documents’ page header and page footer. You can however see these elements by clicking on the “View” menu and there select the “Reading View” option, to see the document with all elements, the way it will look like when you print it out or by selecting the “Header and Footer” option, to edit the header/footer:
Here you find some more extensive information about the differences in the apps:
Aspose.Cells Product Family
I have followed your examples to add a header/footer to excel files .
It works ok, but when I open the file, I cannot see the header / footer of the file until I go to Insert - > header/footer menu in excel ribbon. After I click that, it shows ok.
I have attached a picture showing the desired result.
Do you have any idea why this happens?
Thank you in advance,
Thank you for using Aspose products, and welcome to Aspose.Cells support forum.
Your presented scenario is the default behavior of Excel application (all version), and not a bug of Aspose.Cells APIs. Headers and footers are not displayed on the worksheet in Normal view, instead they are only displayed in Page Layout view and on the printed pages.
Thank you for your understanding.
Thank you for the quick response. Is there any way/setting in the excel file that would open the file with the view that has the header/footer displayed? I will try to set the view to page layout with aspose.
I have found the way : I have used : sheet.ViewType = ViewType.PageLayoutView;
Thank you again,
Hi Dan,Thanks for using Aspose.Cells.It is good to know that your issue has been resolved after setting the sheet view type. Let us know if you encounter any other issue, we will be glad to look into it and help you further.
Do you want to know how to make a header in Excel? Or are you wondering how to add the footer page 1 to the current worksheet? This tutorial will teach you how to quickly insert one of the predefined headers and footers and how to create a custom one with your own text and graphics.
To make your printed Excel documents look more stylish and professional, you can include a header or footer on each page of your worksheet. Generally, headers and footers contain basic information about the spreadsheet such as page number, current date, workbook name, file path, etc. Microsoft Excel provides a handful of predefined headers and footers to choose from, as well as allows creating your own ones.
Headers and footers are displayed only on printed pages, in Print Preview and Page Layout view. In the normal worksheet view, they are not visible.
Inserting a header in an Excel worksheet is quite easy. Here's what you do:
When you print out your worksheet, the header will be repeated on each page.
Like an Excel header, a footer can also be inserted in a few easy steps:
For example, to insert page numbers at the bottom of the worksheet, select one of the footer boxes and click Page Number on the Design tab, in the Header & Footer group.
Microsoft Excel comes equipped with a number of inbuilt headers and footers that can be inserted in your document in a mouse click. Here's how:
As an example, let's insert a footer that displays a page number and file name:
Voila, our Excel footer is created, and the following information will be printed at the bottom of each page:
Two things you should know about preset headers and footers
When inserting an inbuilt header or footer in Excel, please be aware of the following caveats.
Most of the preset headers and footers in Excel are entered as codes, which makes them dynamic - meaning your header or footer will change to reflect the latest changes you make to the worksheet.
For example, the code &[Page] inserts different page numbers on each page and &[File] displays the current file name. To see the codes, just click the corresponding header or footer text box. If you have chosen to add a complex header or footer, chances are that different elements will be inserted in different boxes like in the above example:
2. Preset headers and footers are inserted in predefined boxes
When adding a built-in header or footer, you cannot control the location of specific elements - they are inserted in the predefined boxes no matter which box (left, center, or right) is currently selected. To position the header or footer the way you want, you can move the inserted elements to other boxes by copying / pasting their codes or add each element individually as explained in the next section.
In Excel worksheets, not only can you add preset headers and footers, but also make your own ones with custom text and images.
As usual, you start by clicking the Header & Footer button on the Insert tab. Then, click one of the boxes at the top (header) or at the bottom (footer) of the worksheet and type your text there. You can also enter different pieces of information by selecting one of the built-in elements on the Design tab, in the Header & Footer Elements group.
This example will show you how to create a custom header with your company logo, page numbers, file name and current date.
As soon as you click anywhere outside the header box, an actual picture will show up.
Our custom Excel header looks pretty nice, don't you think?
Add headers and footers using the Page Setup dialog box
If case you'd like to create a header or footer for chart sheets or for several worksheets at a time, the Page Setup dialog box is your option.
To insert a preset one, click the drop-down arrow in the Header or Footer box and choose from the available options. For example:
To create a custom header or footer, do the following:
Tip. To see how your header or footer will look like on a printed page, click the Print Preview button.
There are two ways to edit headers and footers in Excel - in Page Layout view and by using Page Setup dialog.
Change header or footer in Page Layout view
To switch to Page Layout view, go to the View tab > Workbook Views group, and click Page Layout.
Or, click the Page Layout button on the status bar in the bottom-right corner of the worksheet:
Now, you select the header or footer text box and make the desired changes.
Change header or footer in the Page Setup dialog
Another way to modify an Excel footer or header is by using the Page Setup dialog box. Please remember that a header and footer of chart sheets can only be edited in this way.
Once you have finished creating or editing your Excel footer or header, how do you get out of the header and footer view and return to the regular view? By doing any of the following:
On the View tab > Workbook Views group, click Normal.
Or, just click the Normal button on the status bar.
To remove an individual header or footer, simply switch to Page Layout view, click the header or footer text box, and press the Delete or Backspace key.
To delete headers and footers from multiple worksheets at once, carry out these steps:
That's it! All headers and footers in the selected sheets will be removed.
Now that you know the essentials of Excel headers and footers, the below tips may help you avoid common challenges.
How to add header and footer to all or selected sheets in Excel
To insert headers or footers on multiple worksheets at a time, select all target sheets, and then add a header or footer in the usual way.
Once the worksheets are selected, go to the Insert tab > Text group > Header & Footer and enter the header or footer information as you like. Or insert a header/footer via the Page Setup dialog.
When finished, right click any unselected sheet to ungroup the worksheets. If all of the sheets are selected, click any sheet tab, and then click Ungroup Sheets in the context menu.
How to format text in Excel header and footer
To quickly change the font style or font color of your header or footer, select the text and pick the desired formatting option in the pop-up window:
Alternatively, select the header or footer text you want to change, head to the Home tab > Font group and select the formatting options you want.
How to make a different header or footer for the first page
If you'd like to insert a specific header or footer on the first page of your worksheet, you can have it done in this way:
Tip. If you want to create separate headers or footers for odd and even pages, select the Different Odd & Even Pages box, and enter different information on page 1 and page 2.
How avoid resizing the header / footer text when scaling the worksheet for printing
To keep the font size of the header or footer text intact when the worksheet is scaled for printing, switch to Page Layout view, select the header or footer, go to the Design tab and clear the Scale with Document box.
If you leave this checkbox selected, the header and footer font will scale with the worksheet. For example, the header text will become smaller when you select the Fit Sheet on One Page printing option.
That's how you add, change and remove headers and footers in Excel. I thank you for reading and hope to see you on our blog next week.
You may also be interested in