Ниже приведен исходный код C # для этого с SpreadsheetGear for .NET . Поскольку SpreadsheetGear API похож на API Excel, вы должны легко адаптировать этот код к API Excel, чтобы получить тот же результат.
Вы можете скачать бесплатную пробную версию здесь , если хотите попробовать сами.
Отказ от ответственности: я владею SpreadsheetGear LLC
using System;
using SpreadsheetGear;
namespace Program
{
class Program
{
static void Main(string[] args)
{
// Create a new workbook and get a reference to A1.
IWorkbook workbook = Factory.GetWorkbook();
IWorksheet worksheet = workbook.Worksheets[0];
IRange a1 = worksheet.Cells["A1"];
// Format A1 as Text using the "@" format so that the text
// will not be converted to a number, and put the text in A1.
a1.NumberFormat = "@";
a1.Value = "89234010000725515875";
// Show that the formatted value is
Console.WriteLine("FormattedValue={0}, Raw Value={1}", a1.Text, a1.Value);
// Save the workbook.
workbook.SaveAs(@"c:\tmp\Text.xls", FileFormat.Excel8);
workbook.SaveAs(@"c:\tmp\Text.xlsx", FileFormat.OpenXMLWorkbook);
}
}
}