Exemplo n.º 1
0
        public static bool InsertExcelText(this Excel.Worksheet workSheet, int row, int column, ExcelText excelText)
        {
            try
            {
                workSheet.SetCellValue(row, column, excelText.Text);

                Excel.Range range = workSheet.GetCellRange(row, column);

                workSheet.SetFont(range, excelText.Font);

                workSheet.SetHorizontalAlignment(range, excelText.GetHorizontalAlignment());

                return(true);
            }
            catch (Exception ex)
            {
                LogManager.GetLogger().Write(LogLevel.Error, "InsertExcelText Err", ex);
                return(false);
            }
        }