Number of pages of excel sheet

Viewed 166

Does anyone know how to get the number of total pages within a excel sheet via OpenXml? I do NOT need the number of sheets. I need the number of pages within a sheet.

Background: We have to export multiple worksheets into a pdf file. Therefore we have to create a table of content.

Thanks!

EDIT-------

This is how it can be achieved via Office Interop:

var app = new MsExcel.Application();
var wb = app.Workbooks.Add(fullPath);

foreach (Worksheet sheet in wb.Sheets)
{
    sheet.Activate();
    string name = sheet.Name;
    int pages = sheet.PageSetup.Pages.Count;
}

It would be gread if someone knew a solution with OpenXml, ClosedXml or any other free library.

Thanks again!!!

0 Answers
Related