Преобразовать файл MPP Microsoft Project MPP в Excel

Microsoft Project позволяет пользователю экспортировать данные проекта в форматы, поддерживаемые Microsoft Excel, такие как ([ Spreadsheet2003 XML или XLSX Формат).

Это шаги по экспорту данных проекта в форматы Excel:

Предположим, у вас открыт ваш проект в Microsoft Project.

  1. Выберите «Файл \ Сохранить как» пункт меню
  2. Выберите местоположение (например, «Этот компьютер»)
  3. В «Сохранить как» выберите «Рабочая книга Excel» (. XLSX) »или« Excel 97-2003 Workbook (.xls) »в формате« Сохранить как тип ».
  4. Нажмите кнопку «Сохранить»
  5. В мастере экспорта выберите «Шаблон проекта Excel» для применения настроек по умолчанию или «выбранных данных» для настройки вывода.

Пример диалога «Сохранить как»

Если настройки по умолчанию применяются, выходная книга Excel будет выглядеть следующим образом:

Пример экспорта проекта в Excel Workbook

Вы можете экспортировать файл Microsoft Project MPP в форматы файлов электронных таблиц Microsoft Excel Spreadsheet2003 XML или XLSX Программно с использованием Aspose.tasks для API .NET. В этом случае вам не нужно устанавливать Microsoft Project на вашем компьютере.

Конвертировать файлы MS Project MPP в электронную таблицу2003 XML (Excel 2003)

Существует два способа преобразования проектов в формат Sprepsheet2003 XML. Первый - использовать SaveFileformat перечисление. Второй - использовать класс Spreadsheet2003saveOptions.

Чтобы преобразовать файл MSP Project MSP в формат XML Supple2003 с настройками по умолчанию с использованием SaveFileFormat:

  1. Создайте новый экземпляр проекта и загрузите файл MPP.
  2. Преобразовать проект в электронную таблицу2003 XML с использованием метода Project.save и укажите SaveFileFormat.SpreadSheet2003 в качестве аргумента.

Следующие строки кода показывают, как достичь этого в .net:

1Project project = new Project("New Project.mpp");
2project.Save("SaveProjectDataToSpreadsheet2003XML_out.xml", SaveFileFormat.Spreadsheet2003);

To convert MPP files with a non-default settings the Spreadsheet2003SaveOptions class can be used. With this class one can specify additional options to customize the resulting Spreadsheet2003 XML.

  1. Create a new project instance and load the MPP file.
  2. Create an instance of Spreadsheet2003SaveOptions.
  3. Customize view using properties of Spreadsheet2003SaveOptions class.
  4. Convert the project to Excel using Project.Save method and pass the Spreadsheet2003SaveOptions instance as the argument.

Presented below is .NET example showing how to use the convert options:

1Project project = new Project("New Project.mpp");
2Spreadsheet2003SaveOptions options = new Spreadsheet2003SaveOptions();
3GanttChartColumn col1 = new GanttChartColumn("WBS", 100, delegate(Task task) { return task.Get(Tsk.WBS); });
4GanttChartColumn col2 = new GanttChartColumn("Name", 100, delegate(Task task) { return task.Get(Tsk.Name); });
5options.View.Columns.Add(col1);
6options.View.Columns.Add(col2);
7project.Save("UsingSpreadsheet2003SaveOptions_out.xml", options);

Convert MS Project MPP files to Excel XSLX (Excel 2007 and later)

The Project class exposes the Save method which is used to save a project in various formats. The Project.Save method allows you to export project tasks, resources and assignments to separate worksheets to Microsoft Excel XLSX format using the SaveFileFormat enumeration type or the XlsxOptions class.

In order to convert MS Project MPP file to XLSX format with default settings using SaveFileFormat:

  1. Create a new project instance and load the MPP file.
  2. Convert the project to Excel XLSX using Project.Save method and specify the SaveFileFormat.XLSX as the argument.

The following lines of code show how to achieve this in .NET:

1Project project = new Project("New Project.mpp");
2// convert MPP to Excel
3project.Save("MS Project.xlsx", SaveFileFormat.XLSX);

To convert MPP files with a non-default settings the XlsxOptions class is provided. With this class one can specify additional options to customize the resulting XLSX file.

  1. Create a new project instance and load the MPP file.
  2. Create an instance of XlsxOptions.
  3. Customize view using properties of XlsxOptions class.
  4. Convert the project to Excel using Project.Save method and pass the XlsxOptions instance as the argument.

Presented below is .NET example showing how to use the options:

1Project project = new Project("New Project.mpp");
2XlsxOptions options = new XlsxOptions();
3// Customize Gantt Chart View
4GanttChartColumn col1 = new GanttChartColumn("WBS", 100, delegate(Task task) { return task.Get(Tsk.WBS); });
5GanttChartColumn col2 = new GanttChartColumn("Name", 100, delegate(Task task) { return task.Get(Tsk.Name); });
6options.View.Columns.Add(col1);
7options.View.Columns.Add(col2);
8// convert MS Project MPP to Excel
9project.Save("MS Project Gantt Chart.xlsx", options);

Converting MS Project MPP file as CSV

In order to learn how to export MS Project MPP file to CSV please read the article.

Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.