mportMSProjFile(pPath : Text[400];pVisible : Boolean) CLEAR(Task); CLEAR(Tasks); CLEAR(App); IF ISCLEAR(App) THEN CREATE(App); LCtrTask := 0; App.FileOpenEx(pPath); Tasks := App.ActiveProject.Tasks; FOR LCtrTask := 1 TO Tasks.Count DO BEGIN Task := Tasks.Item(LCtrTask); //Row No. WITH ProjMapping DO BEGIN INIT; ID := Task.ID; "Task Name" := Task.Name; Start := Task.Start; Finish := Task.Finish; Resource := Task.ResourceNames; Duration := Finish - Start; Milestone := Task.Milestone; INSERT; END; END; App.Visible := pVisible; IF App.FileExit(0) THEN CLEAR(App);
Comments
After some testing I found out that the error rise when there's an open MSProject file and when it first time I run the codeunit and when trying to run the codeunit in second time it works fine.. I think I missed something before this line Please advise what I missed. Thanks in advance.
Regards,
Sendoh
be smart before being a clever.