Column Letter / Column Address

Mar 28, 2011 at 2:31 PM

Anyone know how to get the full address of an entire column given only a column index? Eg. ColumnIndex = 1, so looking for the full address of that column which is "A:A".  According to the documentation, there is a private GetColumnLetter method, but obviously that's inaccessible.  Is there another method that would do this?



Mar 28, 2011 at 6:27 PM


You can use the MaxRows constant of the ExcelPackage class...

        /// <summary>
        /// Maximum number of columns in a worksheet (16384). 
        /// </summary>
        public const int MaxColumns = 16384;
        /// <summary>
        /// Maximum number of rows in a worksheet (1048576). 
        /// </summary>
        public const int MaxRows = 1048576;

Something like...