How to fix RPC_E_CALL_REJECTED error when opening multiple MS Project files?

0

So im trying to open multiply MS Project files with data from database using MS Project interop. Start with code like this:

application = new MSProject.Application();
application.FileOpenEx(copyPath); // copy file from template
currentProject = application.ActiveProject; 

And then working with its tasks:

MSProject.Task task = application.ActiveProject.Tasks.Add(item.Name);
InitTask(item, task, false); // fill items fields

It works fine with one file opened but i cant open multiple files because i get an exception:

COMException was unhandled --- Call was rejected by callee. (Exception from HRESULT: 0x80010001 (RPC_E_CALL_REJECTED))

It throws at the first:

task.Name = obj.Name;

How can i fix it? Thanks!

c#
ms-project
asked on Stack Overflow Jul 7, 2020 by sergej • edited Jul 7, 2020 by MickyD

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0