Spire.XLS is a professional Excel API that enables developers to create, manage, manipulate, convert and print Excel worksheets. Get free and professional technical support for Spire.XLS for .NET, Java, Android, C++, Python.

Sun Sep 20, 2020 10:05 am

Hi,

I am getting the values in runtime , with a quick watch but when trying to access it says protected value through code

I need to find the value of First Row, First Column for a logic.

Code:

Code: Select all
 

CellRange ranges = sheet.Range[ExcelReportProperties.RangeName];


I would like  "  int FirstColumn= ranges.FirstColumn; " or "  int FirstRow= ranges.FirstRow; "





Kindly help me

Thanks in advance

lijgeorge
 
Posts: 15
Joined: Fri Sep 04, 2020 9:53 am

Mon Sep 21, 2020 2:30 am

Hello,

Thanks for your inquiry.
Please refer to the following code to get the value of the first row, first column in the specified CellRange. Any questions, just feel free to let us know.
Code: Select all
            CellRange ranges = sheet.Range["B1:E1"];
            //Get the index of the first row in the specified cellrange
            int FirstRow = ranges.Row;
            //Get the index of the first column in the specified cellrange
            int FirstColumn = ranges.Column;
            //Get the value of ranges[FirstRow, FirstColumn]
            string value = ranges[FirstRow, FirstColumn].DisplayedText;


Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Return to Spire.XLS