How to write a function to convert Excel to DOCX in C# and VB.Net for 15 minutes?
Key Features
Excel to PDF
>>Excel to DOCX
Excel to RTF
Split and merge PDF
Download trial
Code examples
Video Tutorials
Version History

How to write a function to convert Excel to DOCX in C# and VB.Net for 15 minutes?

How to write a function to convert Excel to DOCX in C# and VB.Net for 15 minutes?


    Imagine, that in 15 minutes after reading this text you will be able to provide API for your application to convert Excel tables into Word (DOCX) using C# or VB.Net.

During the conversion process you may: select custom sheets and area of cells for conversion, specify page properties, add page numbers.

To illustrate how to easily convert Excel workbook to Word (DOCX), let's look at simple code in C#:

1. Add a reference to the "SautinSoft.Excel.dll":

How to add the reference to the SautinSoft.Excel.dll

Type this C# code:

          SautinSoft.ExceltoPdf x = new SautinSoft.ExceltoPdf();
          x.OutputFormat = SautinSoft.ExcelToPdf.eOutputFormat.Docx;
          x.ConvertFile(@"d:\Table.xlsx", @"d:\Table.docx");

Nuget  Online Demo   Download, (Mar 5-th, 2020)

Have a Question?

You have a question, need a support or a code example: ask our support team at We will help you quickly and with pleasure.

What «Excel to PDF .Net» can give me:

  1. Save a time and cost of developing of my application. You will need to only add the reference to "SautinSoft.ExcelToPdf.dll" and write 3-4 C# lines to get ability to convert Excel to PDF, RTF, DOCX.

  2. The one product provides me by set of API to convert .xls and .xlsx to PDF, RTF, DOCX at once, split and merge PDF documents.

  3. Because of this is absolutely standalone .NET Framework and .NET Core assembly, I don't need to worry about the availability of Adobe Acrobat, MS Office, OpenOffice or other software on the my client's computers.

  4. The one time price. I pay a one time and can use «Excel to PDF .Net» for a whole life without any additional fees. My license will never expires.

  5. As bonus, I get unlimited technical support during a whole life for free and independently of the date of my purchasing.

Some examples to convert Excel to Word in C# and VB.Net

1. Let us say, to convert an Excel workbook to DOCX file within C# application:

        static void Main(string[] args)
            // Convert Excel file to DOCX file
            ExcelToPdf x = new ExcelToPdf();

            // Set DOCX as output format.
            x.OutputFormat = SautinSoft.ExcelToPdf.eOutputFormat.Docx;

            string excelFile = @"d:\Tables.xlsx";
            string docxFile = Path.ChangeExtension(excelFile, ".docx"); ;

                x.ConvertFile(excelFile, docxFile);
            catch (Exception ex)

2. Convert .xlsx to .docx in memory within VB.Net application:

    Public Sub ConvertExcelAsMemoryStream()

        ' Convert Excel to DOCX in memory
        Dim x As New ExcelToPdf()

        ' Set DOCX as output format.
        x.OutputFormat = SautinSoft.ExcelToPdf.eOutputFormat.Docx

        Dim excelFile As String = "d:\Schedule.xls"
        Dim docxFile As String = Path.ChangeExtension(excelFile, ".docx")
        Dim docxBytes() As Byte = Nothing

            ' Let us say, we have a memory stream with Excel data.
            Using ms As New MemoryStream(File.ReadAllBytes(excelFile))
                docxBytes = x.ConvertBytes(ms.ToArray())
            End Using
            ' Save docxBytes to a file for demonstration purposes.
            File.WriteAllBytes(docxFile, docxBytes)
        Catch ex As Exception
        End Try
    End Sub

Requirements and Technical Information

     «Excel to PDF .Net» can be used on 32 and 64-bits platforms with .NET Framework 4.0, .NET Core 2.0 and higher. The component doesn't require Microsoft Excel or any other software. It's absolutely standalone and independent library.

Our product is compatible with all .NET languages and supports all Operating Systems where .NET Framework and .NET Core can be used. Note that «Excel to PDF .Net» is entirely written in managed C#.

.Net Framework 4.0 and higher and .Net Core 2.0 and higher

.NET Framework 4.0, 4.5, 4.6.1 and higher.

.NET Core 2.0 and higher.

Multi-platform component, runs on:

Our component has proven itself on cloud platforms and services:

  • Microsoft Azure
  • Amazon Web Services (AWS)
  • Google Cloud Platform
  • SharePoint
  • Docker
  • etc.

Reasonable prices

     The library offers developers high quality conversion at reasonable prices. The main point of interest is that «Excel to PDF .Net» is less expensive than all of its more or less popular counterparts. For example, a single license cost $439(US) with no additional fees or royalties!


To see this functionality firsthand, download the freshest «Excel to PDF .Net» with code examples, 52.0 Mb.


  • Sweden, Stockholm
  • Mortviksvagen 68B 142 43 SKOGAS
  • Tel: +46 812111486
  • Email:
    Copyright © 2002 - 2020 SautinSoft (started from All rights reserved.