We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Header / Footer not showing by default in excel

Greetings,


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,

Dan

Hi Dan,


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.

Hello,


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.

Thank you,

Dan

Edit :

I have found the way : I have used : sheet.ViewType = ViewType.PageLayoutView;

Thank you again,

Dan

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.