Connecting Microsoft Project with Python

rhdariorh 0 Reputation points
2023-07-28T12:14:54.78+00:00

Hello,
I'm stuck in the development of a system that automates Microsoft Project, I hope you can give me a clue where to go from here. In the company where I work we need to automate the creation and modification of tasks in Microsoft Project. We use Project Web App (PWA). The thing is that due to technical requirements our system is based on Python so it would be great to be able to connect with Python to MS Project.

 

I did it, I connect to MS Project Professional using PyWin32 and I managed to create projects, upload them to PWA, and create/modify the 100.000 tasks. Where is the problem? It is extremely slow and takes many hours to create/modify all the tasks, which makes it unfeasible and I need a faster solution. I think it is because I have connected using win32com and this slows down the work. I also think that VBA for Microsoft Project is not very fast.

Does anyone know of a faster way to get me to connect to Project? Maybe directly accessing PWA from Python? But I haven't managed to do that. I would have to create my own Python API? Any other alternative you can think of would be appreciated.

 

Thank you very much and hopefully we can do it.

 

Darío :)

Pipeline TD

SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
2,784 questions
SharePoint Server Development
SharePoint Server Development
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Development: The process of researching, productizing, and refining new or existing technologies.
1,594 questions
{count} votes

1 answer

Sort by: Most helpful
  1. RaytheonXie_MSFT 33,251 Reputation points Microsoft Vendor
    2023-07-31T07:03:00.4033333+00:00

    Hi @rhdariorh,

    Per my reasearch, you can use following code to connect project with python

    https://gist.github.com/zlorb/ff122e8563793bb28f79


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.