Convert to Other Excel Format

This demo uses the DevExpress Spreadsheet Document API to convert an Excel document to another format (XLS,XLSX, XLTX, XLSB, CSV, and more). You can process the sample file or supply your own document. To do the latter, select Upload a File in the file selection drop-down menu.

Use the Convert Document to... dropdown button to select the output format, convert the workbook, and download the result.

Select a Document
InvestmentPortfolio.xlsx



using DevExpress.Spreadsheet;

Stream ConvertDocument(Stream inputStream, DocumentFormat outputFormat) {
    using var workbook = new Workbook();

    // Load the input document
    workbook.LoadDocument(inputStream);

    // Create output stream
    var outputStream = new MemoryStream();

    // Save document in target format
    workbook.SaveDocument(outputStream, outputFormat);

    outputStream.Position = 0;
    return outputStream;
}