Set a custom duration field using VBA throws the message "Invalid duration" when reopening the Project

With a custom code we set Duration9 in Project 2013.
After executing the code everything seems to be ok.
After saving and reopening the Project it shows a message "Invalid Duration", and the value is shown as estimated (Questionmark).
In VBA create following code:
Sub SetDuration()
    Dim newVal As Long
    newVal = 14400
    Tasks(1).Duration9 = newVal
End Sub
Execute Code.
Close VBA.
Open the Project and you will get the same message box
The only way as far as I found out is to manually retype the Duration in that field. What is not exactly what I want.
Is this a bug in MSP or a hidden Feature? Does anyone has an idea?
Best Regards Steffen

I was able to replicate what you saw.  I can't explain it per se, but this code seems to get around the issue:
Sub TESTDUR()
    Dim NewVal As String
    NewVal = "30d"
    ActiveProject.Tasks(1).Duration9 = NewVal
End Sub
Andrew Lavinsky [MVP] Blog: http://azlav.umtblog.com Twitter: @alavinsky

Similar Messages

  • When following your instructions on setting a blank new tab, I get and error message "invalid url", even though the sting entered in the config is as you state.

    I would like a blank new tab to open, but have followed the help guidance to modify the about:config.
    However, for all strings shown, I get a consistent error message "invalid url", even though the string has been copied correctly.

    This issue can be caused by an extension that isn't working properly.
    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance).
    *Do NOT click the Reset button on the Safe mode start window or otherwise make changes.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • Customer's field using BAPI_SLSTRANSACT_CREATEMULTI

    Hi,
    Can someone tell me how to populate customer's fields using BAPI BAPI_SLSTRANSACT_CREATEMULTI'.I have used EEW and it has extended the structure 'CRMT_CUSTOMER_H_COM' but did not extend sructure'BAPIBUS20001_CUSTOMER_H'. So I cannot pass the value.
    Tried to extend 'BAPIBUS20001_CUSTOMER_H' using SE11 but its enhancement category is set to 'Can not be enhanced'.
    Thanks for any suggestion

    Hi Sudesh,
    I think you did not do the enhancement properly in EEWB.
    Just do one thing. Copy the code if you have written any in the EEWB for the enhancement somewhere. Run the EEWB wizard again and regenerate the project. Now paste the code that you had written earlier.
    Use the BAPI_BUSPROCESSND_CREATEMULTI and populate the fields as below:
    DATA: lv_header_guid   TYPE crmt_object_guid,
          lv_item_guid     TYPE crmt_object_guid,
          lit_inputfields  TYPE TABLE OF
                           bapibus20001_input_fields,
          wa_inputfields   LIKE LINE OF lit_inputfields,
          lit_customer_h   TYPE TABLE OF
                           bapibus20001_customer_h,
          wa_customer_h    LIKE LINE OF lit_customer_h,
          lit_header       TYPE TABLE OF
                           bapibus20001_header_ins,
          wa_header        LIKE LINE OF lit_header,
          lit_orderadm_i   TYPE TABLE OF bapibus20001_item,
          wa_orderadm_i    LIKE LINE OF lit_orderadm_i.
    * Fill the HEADER
    * Create Contract header guid
      CALL FUNCTION 'GUID_CREATE'
        IMPORTING
          ev_guid_16 = lv_header_guid.
    * Fill orderadm_h
      wa_header-guid         = lv_header_guid.
      wa_header-process_type = 'ZIUS'.
      APPEND wa_header TO lit_header.
    * Fill input fields
      MOVE: lv_header_guid  TO wa_inputfields-ref_guid,
            'A'             TO wa_inputfields-ref_kind,
            'ORDERADM_H'    TO wa_inputfields-objectname,
            'PROCESS_TYPE'  TO wa_inputfields-fieldname.
      APPEND wa_inputfields TO lit_inputfields.
      CLEAR wa_inputfields.
    * Customer Fields at HEADER Level 
      MOVE lv_header_guid TO wa_customer_h-ref_guid.
      MOVE 'A'            TO wa_customer_h-mode.
    MOVE: lv_terms      TO wa_customer_h-zzcustomer_h0305,
           gv_sales_ch   TO wa_customer_h-zzcustomer_h0301,
           gv_sales_type TO wa_customer_h-zzcustomer_h0302,
           gv_reference  TO wa_customer_h-zzcustomer_h0313,
           gv_creditrate TO wa_customer_h-zzcustomer_h0311.
      APPEND wa_customer_h TO lit_customer_h.
    * Fill input fields
      MOVE: lv_header_guid  TO wa_inputfields-ref_guid,
            'A'             TO wa_inputfields-ref_kind,
            'CUSTOMER_H'    TO wa_inputfields-objectname.
      MOVE 'ZZCUSTOMER_H0305' TO wa_inputfields-fieldname.
      APPEND wa_inputfields TO lit_inputfields.
      MOVE 'ZZCUSTOMER_H0301' TO wa_inputfields-fieldname.
      APPEND wa_inputfields TO lit_inputfields.
      MOVE 'ZZCUSTOMER_H0302' TO wa_inputfields-fieldname.
      APPEND wa_inputfields TO lit_inputfields.
      MOVE 'ZZCUSTOMER_H0313' TO wa_inputfields-fieldname.
      APPEND wa_inputfields TO lit_inputfields.
      MOVE 'ZZCUSTOMER_H0311' TO wa_inputfields-fieldname.
      APPEND wa_inputfields TO lit_inputfields.
      MOVE 'MODE' TO wa_inputfields-fieldname.
      APPEND wa_inputfields TO lit_inputfields.
      CLEAR wa_inputfields.
    * Fill the Item(ORDERADM_I)
      CALL FUNCTION 'GUID_CREATE'
        IMPORTING
          ev_guid_16 = lv_item_guid.
    * Fill ORDERADM_I
      MOVE: lv_item_guid   TO wa_orderadm_i-guid,
            'A'            TO wa_orderadm_i-mode,
            gv_product     TO wa_orderadm_i-ordered_prod,
            lv_header_guid TO wa_orderadm_i-header.
    * Fill input fields
      MOVE: lv_item_guid  TO wa_inputfields-ref_guid,
            'B'           TO wa_inputfields-ref_kind,
            'ORDERADM_I'  TO wa_inputfields-objectname.
      MOVE  'ORDERED_PROD' TO wa_inputfields-fieldname.
      APPEND wa_inputfields TO lit_inputfields.
      MOVE  'PRODUCT' TO wa_inputfields-fieldname.
      APPEND wa_inputfields TO lit_inputfields.
      MOVE  'MODE' TO wa_inputfields-fieldname.
      APPEND wa_inputfields TO lit_inputfields.
      CLEAR wa_inputfields.
    * Customer fields at ITEM Level
    * Similarly fill the values for enahanced fields in
    * lit_customer_i and also the respective input fields in
    * lit_inputfields
    * Fill the rest of the internal tables in the same way
    * Partner, Status, Object, Appointment etc.
    * Now call the BAPI
      CALL FUNCTION 'ZBAPI_CONTRACT_CREATEMULTI'
        TABLES
          header           = lit_header
          item             = lit_orderadm_i
          partner          = lit_partner
          organisation     = lit_organisation
          status           = lit_status
          appointment      = lit_appointment
          input_fields     = lit_inputfields
          return           = lit_ret
          product          = lit_product
          scheduleline     = lit_schline
          customer_head    = lit_customer_h
          customer_item    = lit_customer_i
          pricing          = lit_pricing
          condition_create = lit_condition
          billing          = lit_billing
          config_cfg       = lit_config_cfg
          config_ins       = lit_config_ins
          config_val       = lit_config
          OBJECTS          = lit_object.
    <b>Reward points if it helps.</b>

  • How to Insert Sharepoint 2013 Person or Group Field using VBA

    Hello,
    How to Insert Sharepoint 2013 Person or Group Field using VBA , I tried set the field with ID / ID;Name / Name
    but all failed, Please advice 
    Function SetSP_Field(F_Yer As Single, F_WekNo As Single, F_ProjectNum As String, strField As Variant, strFieldValue As Variant) As String
    ' test code
        Dim rst         As Recordset
        Dim strSQL      As String
        Dim SP_RecSet   As ADODB.Recordset
        Set SP_RecSet = New ADODB.Recordset
        SetSP_Field = False
        strSQL = "Status Report"
        On Error Resume Next
        Call SP_Connect(2)
        strSQL = "select " & SP_List & ".* From  " & SP_List _
               & " Where [Year] = " & CInt(F_Yer) _
               & "   and [WeekNo] = " & CInt(F_WekNo) _
               & "   and [Compass_Code] = '" & F_ProjectNum & "' ; " _
    '           & " Set " & strField & " = " & strFieldValue
        'Debug.Print strSQL
        'Debug.Print SP_CN
        SP_RecSet.Open strSQL, SP_CN, adOpenStatic, adLockOptimistic
        If SP_RecSet.RecordCount = 0 Then
            Debug.Print "Record for project: " & F_ProjectNum & " not found"
            LogFile.WriteLine ("Record " & strID & " not found")
        End If
        If Not SP_RecSet.EOF Then
            'SP_RecSet.Edit
            SP_RecSet.Fields(strField) = strFieldValue
            SP_RecSet.Update
            If Err.Number <> 0 Then
                MsgBox ("SP Update Error: " & Err.Description)
                GoTo Exit_Fun
            End If
            SetSP_Field = True
        End If
    Exit_Fun:
        SP_RecSet.Close
        Set SP_RecSet = Nothing
    End Function

    Hi Tim,
    Let’s verify the followings:
    Whether this issue occurred for other lists in the same site.
    Whether this issue occurred for all users who don’t have full control.
    Whether this issue occurred on other sites.
    When you created the people & group column, which show field did you used? Please try to use a different show field for the people & group column, compare the result.
    In addition, please check if the link is useful:
    http://www.learningsharepoint.com/2013/08/21/empty-value-in-people-picker-after-saving-the-list-form-in-sharepoint/
    Best Regards,
    Wendy
    Wendy Li
    TechNet Community Support

  • Accessing Custom CRM Fields using {module_data}?

    I know I can access CRM data on the site using {module_data version="v3" resource="customers"}.
    Is it possible to access the Custom CRM fields using the {module_data} tag? If so, how do I do that?

    Hi Lynda,
    Vote, comment and add your 2cents to the idea thread of this same idea. And use your powers of persuasion to get BC to hurry up on this feature!
    https://forums.adobe.com/community/business_catalyst/developer_forum/content?filterID=cont entstatus[published]objecttypeobjecttype[idea]
    Please vote, your voice counts.

  • My husband has an iPad and I just got one for me.  We both have the same e-mail address.  The message I get when I try to set my new one up is that the Apple ID is already in use.  How do I set up with our shared e-mail account

    My husband has an iPad and I just got one for me.  We both have the same e-mail address.  The message I get when I try to initiate setup is that the Apple ID is already in use.  Any ideas on how to complete the setup of the new iPad since we both share the e-mail account?

    If you selected open a new Apple ID account, go back a step and enter use existing Apple ID.
    You will have to set up a separate iCloud account or your iPads will mirror each other.

  • When I buy a custom made calendar using iPhoto, what dpi or resolution does Apple print the pictures at?

    When I buy a custom made calendar using iPhoto, what dpi or resolution does Apple print the pictures at?

    The dpi you supply up to a max of 300 DPI as I understand it
    LN

  • On my macbook pro I have a message on my homepage telling me that certain items want to use my keychain. I've pressed cancel the message will not go. The mac is now running very slow and iphoto and safari are not working. Can anyone help?

    On my macbook pro I have a message on my homepage telling me that certain items want to use my keychain. I've pressed cancel the message will not go. The mac is now running very slow and iphoto and safari are not working. Can anyone help?

    What version of Mac OS X?
    What home page?
    What browser?

  • How to get Basic salary amount in the Housing formula to calculate the housing value as I used the DBI (NICDP_EMPLOYEE_BASIC_SALARY_AMOUNT_ASG_ENTRY_VALUE) but when run the Quick pay for the housing element alone result come 0, How to get Basic salary amo

    How to get Basic salary amount in the Housing formula to calculate the housing value as I used the DBI (NICDP_EMPLOYEE_BASIC_SALARY_AMOUNT_ASG_ENTRY_VALUE) but when run the Quick pay for the housing element alone result come 0, How to get Basic salary amount in the Housing formula to calculate the housing value as I used the DBI (NICDP_EMPLOYEE_BASIC_SALARY_AMOUNT_ASG_ENTRY_VALUE) but when run the Quick pay for the housing element alone result come 0

    Hi,
    Is your formula attached to basic salary element or some other element? You need to make sure that basic salary element has some value and is processed before this formula is called. Are you able to see value for basic salary element after payroll run?
    Regards,
    Pawan

  • When and how does the message context get removed from the message when we use pass thru send port

    Friends,
    i have a doubt regarding message context.
    Assume i have used XMLRecieve pipeline in the receive side to receive the message so that the message context is created. I.e properties are promoted/written.
    now if we use pass thru transmit pipe line at send side, how and when does the message context get removed from the message?? Since pass thru does not have any stages/components, how does the message context removed and sent out a pure message to destination???
     i mean what exactly happens here to remove the context??
    Ravindar

    Thanks for the reply.
    "The Context is created by the Adapter, regardless of any Pipeline or Pipeline Component.  It has nothing to do with PassThrough vs. XmlReceive, although XmlReceive will write Promoted Properties to the existing Context,
    as can any other Component."
    yeah yeah, adapter does create some properties in context. You are right, i am aware of it. I just missed to explain it clearly. what i meant is addition of context properties will not happen if pass thru used. Thanks its clear.
    "No.  The Context already exists on the Message when it comes from the MessageBox and
    is equally available to any Component in any Stage.  The Context that hits the Pipeline is whatever was last Persisted, either by a Receive Port or Orchestration.  It is not created by the XmlAssembler (XmlTransmit)"
    You are right , the context already exists on the message while it leaves the receive port, and once it persists
    to message box the context and message context gets stored in messages in relative tables.
    Now as you said the components get the message from the last persistence, assume i have a send port(with passthru)
    subscriber and a orchestration subsrciber for this message.
    Orchestration gets the message with context right!!
    if the send sendport(with passthru) also gets message along with context, then where is this context removed/demoted
    while sending it out?.  i guess as per SAAkhlaq said,
    here sendport(with passthru) should get a pure message without context as passthru used. 
    or is it that ultimately send adapter removes the context completely?
    or is it something like biztalk run time load the context from database into cache and both orchestration and send port gets pure message, and if needed they use context from cache???
    sorry i may be troubling you, but i am confused. i hope i am not creating any nuisance with this
    post.
    Ravindar

  • I have Macromedia Fireworks 3.0 and the install process doesn´t run! After the installation the message is: fireworks cannot run. the resource files are missing or damaged. I use Windows 8.1

    I have Macromedia Fireworks 3.0 and the install process doesn´t run! After the installation the message is: fireworks cannot run. the resource files are missing or damaged. I use Windows 8.1. Antworten auf Deutsch wären super!

    As far as I know there is no download resource for older Macromedia programs and it is highly unlikely that one as old as version 3 of Fireworks will be able to work on a Windows 8.1 system.  I was unable to get a Studio 8 version installation on a Vista system, and likely even an XP system (cannot remember that far back).

  • IPad mini hangs on the Internet. Will not start. Have rebooted the home and on / off. There is internet in the house (using it now). Getting the message: Safari can not open the page ...... What do I do?

    My IPad mini hangs on the Internet. Will not start. Have rebooted the home and on / off. There is internet in the house (using it now). Getting the message: Safari can not open the page ...... What do I do?

    Try this:
    1. Close all inactive apps in the Task Bar. Double-click the Home button and hold apps down for a second or two. Tap the minus sign to close app.
    2. Hold the Sleep and Home button down for about 10 seconds until you see the Apple Logo.

  • The backup disk image "/Volumes/Time Capsule Disk/Earl Burroughs's MacBook Pro.sparsebundle" is already in use. This is the message I get when it tries to back up, it had been working fine prior to this.....

    The backup disk image “/Volumes/Time Capsule Disk/Earl Burroughs’s MacBook Pro.sparsebundle” is already in use. This is the message I get when it tries to back up, it had been working fine prior to this.....

    The Backup disk image ... sparsebundle ... is already in use.

  • I use an iPad 3 with IOS6. When opening the calendar and strolling to march 2013, calender always shuts down.

    I use an iPad 3 with IOS6. When opening the calendar and strolling to MARCH 2013 calender shuts down...
    Anybody with same problem or having a solution?

    Try removing any all-day events from the calendar for the 1st April 2013 e.g. if you are syncing the calendar from somewhere else (e.g. Outlook on a PC or iCal/Calendar on a Mac) then change it to a timed event instead of all-day - it seems that there is a problem with all day events on that date which is when the clocks change due to daylight saving.

  • Delete Power Query queries' custom XML data using VBA

    I have Power Query queries in an Excel 2010 file and would like to delete these queries using VBA. so far I can achieve that manually with the following steps:
    unload Power Query addin
    run Document Inspector and click to delete Custom XML data
    The Macro recorder record the following code for step 2.
    Sub Makro1()
    ' Makro1 Makro
    ActiveWorkbook.RemoveDocumentInformation (xlRDIPrinterPath)
    ActiveWorkbook.RemoveDocumentInformation (xlRDIDocumentProperties)
    ActiveWorkbook.RemoveDocumentInformation (xlRDIInactiveDataConnections)
    End Sub
    However, using this macro I do not achieve the same result (=PQ query code gone from the workbook).
    Any ideas on how to achieve the PQ query codes to be removed using VBA?

    On some cases Macro Recording is not complete, and misses to record the full set of VBA to automate the actions you record. This is probably such a case.
    We are looking into future ways to allow you automate Power Query cleanup.
    For the time being, please see if the
    Document Inspector interface can clean the custom XML data (which holds the Power Query data structures).
    thx, Gil.

Maybe you are looking for

  • CONVERT_OTF Convert TO PDF the Chinese font bold is lost

    Dear All,      When I use CONVERT_OTF Convert TO PDF the Chinese font bold is lost, but use Print to PDF method, the Font Bold can be showed normal. Also used these reports RSTXPDFT4, RSTXPDF2UC, it does not work. How can I solve this issue? Many Tha

  • Using Wildcard in Parameters

    I have several columns used as parameters but the end users would like to be able to search instead of grabbing the entire column. For instance, there is a number column that has size 10. If the data is 5023495999, then they would like to be able to

  • IPhoto misbehaving in Full Screen mode?

    Anyone having trouble with iPhoto dropping out of Full Screen mode? It keeps happening to me. I set up iPhoto in full screen mode and the next thing I know, it's in some sort of middle ground where it occupies the full screen but with a bunch of othe

  • Saving PNG file with transparency

    Hello! In my application I generate "BufferedImage"s with transparent pixels. When I try to write them using ImageIO.write() in PNG format, the transparency information is lost. Can anybody send me working code for this problem? Thanks, Norbi

  • Change of status of calibration instruments

    Hi, For Calibration scenario in PM module, if Q category instrument is assigned to M category superior equipemnt then is it possible to change status of Q category instrument at UD level. Pl suggest. Ankit