Convert MPP to XLSX using C#

This quick guide explains how to convert MPP to Excel using C#. You will learn to add custom columns to the default sheets in the output Excel file. It will also share the IDE settings, a list of steps, and sample code for changing MPP to Excel using C#.

Steps to Convert MS Project to Excel using C#

  1. Set the environment to use Aspose.Tasks for .NET for converting an MPP to Excel format
  2. Apply the product license to use the library without limitations
  3. Load the existing MPP project file into memory
  4. Create an object of XlsxOptions that controls the conversion of the MPP file to an Excel format
  5. Add columns to the task view sheet of the output Excel file
  6. Add a column to the resource view sheet
  7. Add a column to the assignment view sheet in the Excel file
  8. Save the project as an Excel file using the above-mentioned columns configuration

These steps describe how to convert MPP to XLSX using C#. Load the product license, load the source MPP file into memory, define the XlsxOptions to control the generation of the Excel file, and add a few columns to the first sheet of the Excel file. Add more columns to the second sheet resource table, third sheet assignment table, and finally save the output Excel file.

Code to Convert Microsoft Project to Excel using C#

This sample code demonstrates how to convert Microsoft Project file to Excel using C#. If you do not use the XlsxOptions object and directly save the source MPP file right after loading it into memory, it has three sheets by default i.e. Task table, Resource table, and Assignment table, containing a pre-defined set of columns in them. If you want to add more columns to the above-mentioned sheets, use GanttChartColumn to add columns to the Task sheet, ResourceViewColumn to add columns to the Resource sheet, and AssignmentViewColumn to add columns to the Assignment sheet.

This article teaches how to produce an Excel file from an MPP file. To create predecessor tasks in a project file, refer to the article Set Predecessor in MS Project using C#.

 English