Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Merging data with Microsoft Project 1

Status
Not open for further replies.

Krusher

IS-IT--Management
Jan 2, 2003
70
US
I am currently merging data from Excel to Microsoft Project using a Macro with the MapEdit fuction. Basically, I need help with an IF Statement. In plain English, I'd like to do this simple thing, IF for all tasks, fieldname STATUS = "COMPLETE" then Create:=True, ELSE Create:=False. Below is a portion of the code:

SelectRange Row:=0, Column:=6
MapEdit Name:="Map 4", Create:=True, OverwriteExisting:=True, DataCategory:=0, CategoryEnabled:=True, TableName:="Sheet1", FieldName:="Name", ExternalFieldName:="Name", ExportFilter:="All Tasks", ImportMethod:=2, MergeKey:="Name", HeaderRow:=True, AssignmentData:=False, TextDelimiter:=Chr$(9), TextFileOrigin:=0, UseHtmlTemplate:=False, IncludeImage:=False
MapEdit Name:="Map 4", DataCategory:=0, FieldName:="Status", ExternalFieldName:="Status"


Any thoughts would be greatly appreciated. Thank you in advance.

-K
 

Hi,

I noticed that no one has tackeled this question.

Frankly, I know nothing about the MS Project Object Model. I can't find the object library.

But there is often some similarity in object models. So I'll take a stab to see it it might help.
Code:
Sub test()
    Dim bCreate As Boolean
    If Status = "COMPLETE" Then
        bCreate = True
    Else
        bCreate = False
    End If
    [b]'is there REALLY a ROW ZERO????[/b]
    Range([b]0[/b], 6).MapEdit _
        Name:="Map 4", _
        Create:=[b][red]bCreate[/red][/b]_
        OverwriteExisting:=True, _
        DataCategory:=0, _
        CategoryEnabled:=True, _
        TableName:="Sheet1", _
        FieldName:="Name", _
        ExternalFieldName:="Name", _
        ExportFilter:="All Tasks", _
        ImportMethod:=2, _
        MergeKey:="Name", _
        HeaderRow:=True, _
        AssignmentData:=False, _
        TextDelimiter:=Chr$(9), _
        TextFileOrigin:=0, _
        UseHtmlTemplate:=False, _
        IncludeImage:=False
    Range(0, 6).MapEdit _
        Name:="Map 4", _
        DataCategory:=0, _
        FieldName:="Status", _
        ExternalFieldName:="Status"
    End With
    
End Sub


Skip,

[glasses] [red]Be Advised![/red]
The band of elderly oriental musicians, known as Ground Cover, is, in reality...
Asian Jasmine![tongue]
 
Skip,
You helped solve my if statement issue. Thank you :)

-K
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top