Spire.XLS is a professional Excel .NET library that can be used to any type of .NET( C#, VB.NET, ASP.NET, .NET Core) application and Java (J2SE and J2EE) application.

Thu Jul 11, 2013 1:06 pm


Is there a way we can retreive the headers from an Excel file, without having to completely load it into a datatable? (which causes much load time for very big files).


Posts: 8
Joined: Thu Oct 20, 2011 9:09 am

Fri Jul 12, 2013 3:05 am

Dear Calago,

Thanks for your inquiry.
Please try the code snippet as below to get headers.
Code: Select all
            // Get text and image in the left header
            string headerLeftText = worksheet.PageSetup.LeftHeader;
            Image headerLeftImage = worksheet.PageSetup.LeftHeaderImage;

            // Get text and image in the center header
            string headerCenterText = worksheet.PageSetup.CenterHeader;
            Image headerCenterImage = worksheet.PageSetup.CenterHeaderImage;
            // Get text and image in the right header
            string headerRightText = worksheet.PageSetup.RightHeader;
            Image headerRightImage = worksheet.PageSetup.RightHeaderImage;     

If you have other any problem, please feel free to contact us.

E-iceblue support team
User avatar

Posts: 2524
Joined: Wed Jun 27, 2012 8:50 am

Wed Jul 17, 2013 9:57 am

Hello Calago,

Have you tried the code provided by AMY? Has the issue been resolved? Could you please update the thread if convenience?

If there are any questions, welcome to get it back to us.

E-iceblue support team
User avatar

Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Return to Spire.XLS