Getting Print Area from a Sheet of Existing Excel File
In This Topic
To get the print area from an Excel sheet, use the following code:
C1XLBook1.Load("..\..\InputFile.xlsx")
For Each nr As XLNamedRange In C1XLBook1.NamedRanges
If nr.Name.StartsWith("Print_Area") Then
System.Diagnostics.Debug.WriteLine(nr.Name + nr.CellRanges.ToString())
End If
Next
C1XLBook1.Load("..\\..\\InputFile.xlsx");
foreach (XLNamedRange nr in C1XLBook1.NamedRanges)
{
if (nr.Name.StartsWith("Print_Area"))
{
System.Diagnostics.Debug.WriteLine(nr.Name + nr.CellRanges.ToString());
}
}