FileInfo fileInfo = new FileInfo(filePath);
string directoryName = fileInfo.DirectoryName;
string outputFileName = Path.GetFileNameWithoutExtension(fileInfo.Name) + "_wrapped" + fileInfo.Extension;
string outputFilePath = Path.Combine(directoryName, outputFileName);
ExcelPackage.LicenseContext = OfficeOpenXml.LicenseContext.NonCommercial; // Set EPPlus license context
using (var package = new ExcelPackage(fileInfo)) // Load and process the Excel file
{
var worksheet = package.Workbook.Worksheets[0]; // Get the first worksheet
int rowCount = worksheet.Dimension.Rows; // Get the dimensions of the worksheet
int colCount = worksheet.Dimension.Columns;
Console.WriteLine("Wrapping text in all cells...");
for (int row = 1; row
Подробнее здесь: https://stackoverflow.com/questions/792 ... gth-actual
Мобильная версия