Exemplo n.º 1
0
        /// <summary>
        /// Gets the Escel range from worksheet.
        /// </summary>
        /// <param name="worksheet">The worksheet.</param>
        /// <param name="area">The area.</param>
        /// <returns></returns>
        public static ExcelRange getExcelRange(this selectRangeArea area, ExcelWorksheet worksheet)
        {
            area = area.normalizeRange();

            ExcelRange range = null;

            try
            {
                range = worksheet.Cells[area.TopLeft.y + 1, area.TopLeft.x + 1, area.BottomRight.y + 1, area.BottomRight.x + 1];
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(range);
        }