J
jeremy
Can someone see what I am obviously missing?
I am trying to write a maco to automate the merge of a csv file into a
resource pool file. I am getting the above error code and the
following explanation:
"The MergeKey argument is required when merging has been specified as
the input method."
I thought I had done that but the debug points me to the first MapEdit
line as the problem area. The coding is as follows:
Sub ImportCosts()
' Macro ImportCosts
' 29/08/2008 by Jeremy Crompton.
MapEdit Name:="Map 5", Create:=True, OverwriteExisting:=True,
DataCategory:=1, CategoryEnabled:=True, TableName:="BSI_Resource",
FieldName:="ID", ExternalFieldName:="ID", ExportFilter:="All
Resources", ImportMethod:=pjImportMerge, HeaderRow:=True,
AssignmentData:=False, TextDelimiter:=",", TextFileOrigin:=0,
UseHtmlTemplate:=False, IncludeImage:=False
MapEdit Name:="Map 5", DataCategory:=1, FieldName:="Unique ID",
ExternalFieldName:="Unique_ID", MergeKey:="Unique ID"
MapEdit Name:="Map 5", DataCategory:=1, FieldName:="Name",
ExternalFieldName:="Resource_Name"
MapEdit Name:="Map 5", DataCategory:=1, FieldName:="Initials",
ExternalFieldName:="Initials"
MapEdit Name:="Map 5", DataCategory:=1, FieldName:="Max Units",
ExternalFieldName:="Max_Units"
MapEdit Name:="Map 5", DataCategory:=1, FieldName:="Standard
Rate", ExternalFieldName:="Standard_Rate"
MapEdit Name:="Map 5", DataCategory:=1, FieldName:="Overtime
Rate", ExternalFieldName:="Overtime_Rate"
MapEdit Name:="Map 5", DataCategory:=1, FieldName:="Cost Per Use",
ExternalFieldName:="Cost_Per_Use"
MapEdit Name:="Map 5", DataCategory:=1, FieldName:="Accrue At",
ExternalFieldName:="Accrue_At"
MapEdit Name:="Map 5", DataCategory:=1, FieldName:="Cost",
ExternalFieldName:="Cost"
MapEdit Name:="Map 5", DataCategory:=1, FieldName:="Baseline
Cost", ExternalFieldName:="Baseline_Cost"
MapEdit Name:="Map 5", DataCategory:=1, FieldName:="Actual Cost",
ExternalFieldName:="Actual_Cost"
MapEdit Name:="Map 5", DataCategory:=1, FieldName:="Work",
ExternalFieldName:="Scheduled_Work"
MapEdit Name:="Map 5", DataCategory:=1, FieldName:="Baseline
Work", ExternalFieldName:="Baseline_Work"
MapEdit Name:="Map 5", DataCategory:=1, FieldName:="Actual Work",
ExternalFieldName:="Actual_Work"
MapEdit Name:="Map 5", DataCategory:=1, FieldName:="Overtime
Work", ExternalFieldName:="Overtime_Work"
MapEdit Name:="Map 5", DataCategory:=1, FieldName:="Group",
ExternalFieldName:="Group_Name"
MapEdit Name:="Map 5", DataCategory:=1, FieldName:="Code",
ExternalFieldName:="Code"
MapEdit Name:="Map 5", DataCategory:=1, FieldName:="Text1",
ExternalFieldName:="Text1"
MapEdit Name:="Map 5", DataCategory:=1, FieldName:="Text2",
ExternalFieldName:="Text2"
MapEdit Name:="Map 5", DataCategory:=1, FieldName:="Text3",
ExternalFieldName:="Text3"
MapEdit Name:="Map 5", DataCategory:=1, FieldName:="Text4",
ExternalFieldName:="Text4"
MapEdit Name:="Map 5", DataCategory:=1, FieldName:="Text5",
ExternalFieldName:="Text5"
MapEdit Name:="Map 5", DataCategory:=1, FieldName:="Email
Address", ExternalFieldName:="Email_Address"
FileOpen Name:="\\cam249df\m117917$\Private\BSI\Project Planning
\Resources\BSI_Resource_Costs.csv", ReadOnly:=False, Merge:=1,
FormatID:="MSProject.CSV", map:="Map 5"
End Sub
I am using MS Project Pro 2003
Thanks in advance
I am trying to write a maco to automate the merge of a csv file into a
resource pool file. I am getting the above error code and the
following explanation:
"The MergeKey argument is required when merging has been specified as
the input method."
I thought I had done that but the debug points me to the first MapEdit
line as the problem area. The coding is as follows:
Sub ImportCosts()
' Macro ImportCosts
' 29/08/2008 by Jeremy Crompton.
MapEdit Name:="Map 5", Create:=True, OverwriteExisting:=True,
DataCategory:=1, CategoryEnabled:=True, TableName:="BSI_Resource",
FieldName:="ID", ExternalFieldName:="ID", ExportFilter:="All
Resources", ImportMethod:=pjImportMerge, HeaderRow:=True,
AssignmentData:=False, TextDelimiter:=",", TextFileOrigin:=0,
UseHtmlTemplate:=False, IncludeImage:=False
MapEdit Name:="Map 5", DataCategory:=1, FieldName:="Unique ID",
ExternalFieldName:="Unique_ID", MergeKey:="Unique ID"
MapEdit Name:="Map 5", DataCategory:=1, FieldName:="Name",
ExternalFieldName:="Resource_Name"
MapEdit Name:="Map 5", DataCategory:=1, FieldName:="Initials",
ExternalFieldName:="Initials"
MapEdit Name:="Map 5", DataCategory:=1, FieldName:="Max Units",
ExternalFieldName:="Max_Units"
MapEdit Name:="Map 5", DataCategory:=1, FieldName:="Standard
Rate", ExternalFieldName:="Standard_Rate"
MapEdit Name:="Map 5", DataCategory:=1, FieldName:="Overtime
Rate", ExternalFieldName:="Overtime_Rate"
MapEdit Name:="Map 5", DataCategory:=1, FieldName:="Cost Per Use",
ExternalFieldName:="Cost_Per_Use"
MapEdit Name:="Map 5", DataCategory:=1, FieldName:="Accrue At",
ExternalFieldName:="Accrue_At"
MapEdit Name:="Map 5", DataCategory:=1, FieldName:="Cost",
ExternalFieldName:="Cost"
MapEdit Name:="Map 5", DataCategory:=1, FieldName:="Baseline
Cost", ExternalFieldName:="Baseline_Cost"
MapEdit Name:="Map 5", DataCategory:=1, FieldName:="Actual Cost",
ExternalFieldName:="Actual_Cost"
MapEdit Name:="Map 5", DataCategory:=1, FieldName:="Work",
ExternalFieldName:="Scheduled_Work"
MapEdit Name:="Map 5", DataCategory:=1, FieldName:="Baseline
Work", ExternalFieldName:="Baseline_Work"
MapEdit Name:="Map 5", DataCategory:=1, FieldName:="Actual Work",
ExternalFieldName:="Actual_Work"
MapEdit Name:="Map 5", DataCategory:=1, FieldName:="Overtime
Work", ExternalFieldName:="Overtime_Work"
MapEdit Name:="Map 5", DataCategory:=1, FieldName:="Group",
ExternalFieldName:="Group_Name"
MapEdit Name:="Map 5", DataCategory:=1, FieldName:="Code",
ExternalFieldName:="Code"
MapEdit Name:="Map 5", DataCategory:=1, FieldName:="Text1",
ExternalFieldName:="Text1"
MapEdit Name:="Map 5", DataCategory:=1, FieldName:="Text2",
ExternalFieldName:="Text2"
MapEdit Name:="Map 5", DataCategory:=1, FieldName:="Text3",
ExternalFieldName:="Text3"
MapEdit Name:="Map 5", DataCategory:=1, FieldName:="Text4",
ExternalFieldName:="Text4"
MapEdit Name:="Map 5", DataCategory:=1, FieldName:="Text5",
ExternalFieldName:="Text5"
MapEdit Name:="Map 5", DataCategory:=1, FieldName:="Email
Address", ExternalFieldName:="Email_Address"
FileOpen Name:="\\cam249df\m117917$\Private\BSI\Project Planning
\Resources\BSI_Resource_Costs.csv", ReadOnly:=False, Merge:=1,
FormatID:="MSProject.CSV", map:="Map 5"
End Sub
I am using MS Project Pro 2003
Thanks in advance