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!
User contributions licensed under CC BY-SA 3.0