I've been trying to import project data from Excel into MS Project; specifically the task Name, Outline Level, and Created, Start, Finish, and Actual Finish dates. I am able to import all of the data just fine...except for the Actual Finish dates. All of the Actual Finish dates are being populated with NA instead of the actual dates.
I was originally just trying to do the import through MS Project's import wizard. Then I recorded the following macro, which yielded the same result. (It's the first macro I've ever done for MS Project, but I have used VBA with Excel before.) Is there a rule set where having any of the other dates in the import would somehow cause the Actual Finish dates to force an NA? Or do you know any other reason for my problem?
Sub Import()
' Macro Import
' Macro Recorded Thu 3/18/21 by Pincince; Marc.
MapEdit Name:="Map ", Create:=True, OverwriteExisting:=True, DataCategory:=0, CategoryEnabled:=True, _
TableName:="Cleaned", FieldName:="Name", ExternalFieldName:="Summary", ExportFilter:="All Tasks", ImportMethod:=0, _
HeaderRow:=True, AssignmentData:=False, TextDelimiter:=Chr$(9), TextFileOrigin:=0, UseHtmlTemplate:=False, IncludeImage:=False
MapEdit Name:="Map ", DataCategory:=0, FieldName:="Outline Level", ExternalFieldName:="Outline_Level"
MapEdit Name:="Map ", DataCategory:=0, FieldName:="Created", ExternalFieldName:="Created"
MapEdit Name:="Map ", DataCategory:=0, FieldName:="Start", ExternalFieldName:="Start_date"
MapEdit Name:="Map ", DataCategory:=0, FieldName:="Finish", ExternalFieldName:="Due_date"
MapEdit Name:="Map ", DataCategory:=0, FieldName:="Actual Finish", ExternalFieldName:="Actual_Completion_Date"
MapEdit Name:="Map ", DataCategory:=0, FieldName:="Notes", ExternalFieldName:="Notes_w_Comments"
FileOpenEx Name:="MYPATH\Project Import Prep.xlsx", _
ReadOnly:=False, Merge:=0, FormatID:="MSProject.ACE.14", map:="Map ", DoNotLoadFromEnterprise:=True
End Sub
When the % Complete field is not imported those field values default to 0 and Actual Finish will be ignored. The trick is to include % Complete and not import Actual Finish; the Finish date is used to set the Actual Finish when % Complete = 100.