Skip to content

Instantly share code, notes, and snippets.

@groupdocs-cloud-gists
Last active February 18, 2025 09:04
Show Gist options
  • Save groupdocs-cloud-gists/b1969966e5885f1a84cb209fe0c6c56f to your computer and use it in GitHub Desktop.
Save groupdocs-cloud-gists/b1969966e5885f1a84cb209fe0c6c56f to your computer and use it in GitHub Desktop.
Convert MPP to Excel

Export MPP to Excel in C# .NET


This page provides a step-by-step guide on how to export MS Project files to Excel using C# .NET and REST API. Whether you're looking to convert MPP to XLS or XLSX, this approach simplifies the conversion process. The conversion is perfomred using GroupDocs.Conversion Cloud SDK for .NET



For more details, please visit How to Convert MPP to Excel Online.

MPP to excel

Important Links

Product Page | Docs | Live Demo | API Reference | Code Samples | Source Code | New Releases | Blog | Free Support | Free Trial

How to convert MPP to Excel Workbook in C# .NET
// More examples over https://github.com/groupdocs-conversion-cloud/groupdocs-conversion-cloud-dotnet
// Obtain your API credentials
string clientId = "XXXXXX-XXXXXXXXX-4088-9ca0-55c38f4b7f22";
string clientSecret1 = "XXXXXXXXXXXXXXXXXXXX";
// Create an instance of the Configuration class and initialize it with the Client ID & Client Secret.
var configurations = new Configuration(clientId, clientSecret1);
// Define the value of ApiBaseUrl to set the base url for MPP to Excel conversion API.
configuration.ApiBaseUrl = "https://api.groupdocs.cloud";
// Initialize an instance of the ConvertApi class with an object of Configuration class.
var apiInstance = new ConvertApi(configurations);
// load the input MPP from local drive
using (var stream = System.IO.File.OpenRead("Home move plan.mpp"))
{
// create an instance of FileApi
var fileUpload = new FileApi(configurations);
// upload the input MPP to cloud storage
fileUpload.UploadFile(new UploadFileRequest("input.mpp", stream));
// create ConvertSettings where we specify the name of input MPP and the name for resultant XLS file
var settings = new ConvertSettings
{
StorageName = "default",
FilePath = "input.mpp",
Format = "xls",
OutputPath = "converted.xls"
};
// Invoke the ConvertDocument method for MPP to Excel conversion operation.
var response = apiInstance.ConvertDocument(new ConvertDocumentRequest(settings));
if (response != null && response.Equals("OK"))
{
// print success message
Console.WriteLine("MPP to HTML conversion completed successfully !");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment