Aspose.Cells.Examples.CSharp.Data.Processing.TracingPrecedents.Run C# (CSharp) Method

Run() public static method

public static Run ( ) : void
return void
        public static void Run()
        {
            // ExStart:1
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
            
            Workbook workbook = new Workbook(dataDir + "Book1.xlsx");
            Cells cells = workbook.Worksheets[0].Cells;
            Cell cell = cells["B4"];

            ReferredAreaCollection ret = cell.GetPrecedents();
            ReferredArea area = ret[0];
            Console.WriteLine(area.SheetName);
            Console.WriteLine(CellsHelper.CellIndexToName(area.StartRow, area.StartColumn));
            Console.WriteLine(CellsHelper.CellIndexToName(area.EndRow, area.EndColumn));
            // ExEnd:1
            Console.ReadKey();
        }
    }
TracingPrecedents