none
Run-time error '1011'. The argument value is not valid. when running macros in ms project 2016

    Pertanyaan

  • Hello,

    I'm using MS Project 2016, and having some VBA trouble. The VBA created formats a date box and changes its size and color based on whether its a Risk, Opportunity or both. In another project file the VBA is working correctly, but when I try to apply to other project plans I receive the "Run-time error '1101':The argument value is not valid." Error. I would sincerely appreciate it if someone could please assist. Below are the three VBA's running with the error:

    Sub ExpandRiskG()
    ' Macro ExpandRisk
    ' Macro Recorded Fri 12/1/17 by, David , Erik
        Set task_current = ActiveCell.Task
        BoxFormatEx DataTemplate:="Accel Box Dates w/Risk", HorizontalGridlines:=True, VerticalGridlines:=True, BorderShape:=pjBoxRectangle, BorderWidth:=4, Reset:=False, BorderColor:=255
        task_current.Text6 = "Risk"
    End Sub

    Sub ExpandOppG()
    ' Macro ExpandOpp
    ' Macro Recorded Fri 12/1/17 by, David Erik
        Set task_current = ActiveCell.Task
        BoxFormatEx DataTemplate:="Accel Box Dates w/RISK", HorizontalGridlines:=True, VerticalGridlines:=True, BorderShape:=pjBoxRectangle, BorderWidth:=4, Reset:=False, BorderColor:=5287936
        task_current.Text6 = "Opportunity"
    End Sub

    Sub ExpandRiskOppG()
    ' Macro ExpandRiskOpp
    ' Macro Recorded Fri 12/1/17 by , David & , Erik
        Set task_current = ActiveCell.Task
        BoxFormatEx DataTemplate:="Accel Box Dates w/RISK", HorizontalGridlines:=True, VerticalGridlines:=True, BorderShape:=pjBoxRectangle, BorderWidth:=4, Reset:=False, BorderColor:=RGB(255, 255, 0)
        task_current.Text6 = "Risk & Opportunity"
    End Sub

    Kamis, 11 Oktober 2018 17.13

Semua Balasan

  • Hi,

    if you get the error at BoxFormatEx, I assume that your custom DataTemplates are not available in this project. To make them available, copy view "Network Diagram" from the working project to the failing project (using Organizer)

    If it fails at task_current.Text6, I think there is a formula for custom field Text6.

    Regards
    Barbara

    Kamis, 11 Oktober 2018 17.30
    Moderator