Forum Discussion
Using Interop with Project Professional 2021
Our product supports importing data from Project using the Project Interop.
As part of this feature we have code to test if Project is installed on the machine so that we can enable/disable the menu options involved. For this we use the standard GetTypeFromProgID to see if it is installed and then get the version number.
private const string MicrosoftProjectProgId = "MSProject.Application";
.
.
.
var type = Type.GetTypeFromProgID(MicrosoftProjectProgId);
We are now testing this on Windows 11 with Project Professional 2021 installed and it appears there is no registry entry for MSProject.Application.
From there we get the currently running instance of Project using GetActiveObject which I am assuming will fail since we rely on the ProgId again.
Marshal.GetActiveObject(MicrosoftProjectProgId) as RemoteApp
Is this a change in Project 2021?Can we no longer rely on it being registered? I am looking for how to update our approach but struggling to find firm documentation on changes and guidance.
- Not sure. Before I got an answer our IT re-installed 2021 on the machine where things weren't working and now things are working fine. Might have just been an installation issue I guess.
Hello James_Pike ,
I've not looked at this but just a thought, does this work for Word or Excel 2021?
Thanks
- James_PikeCopper Contributor
Not sure. Interestingly I found another test VM of ours with Windows 11 and Project Professional 2021 where things do work. That server seems to have the registry entries:
While the one that does work seems to lack the ProgID entries.
Hi James_Pike ,
Were both systems in the same state before Project Pro 2021 was deployed? For example, was one an upgrade / had an earlier version of Project Pro installed or both clean and Project Pro 2021 was the first app deployed?