none
How to get the string for the parameter HourLabelDisplay = 0 (using the OptionsEditEx method ) RRS feed

  • Question

  • Hi,

    I am trying to figure out how I can get some function to return to me the string that represents the actual character(s) for the parameter HourLabelDisplay when it's value is = 0 (zero) ie., in the OptionsEditEx method ?  This method as you may know helps set or returns various option settings in MS Project.

    My aim: I am trying to write my code in a way that will be able to run in any language MS Project is installed in.  Therefore, I would like my code to figure out what the "default" string (or character) is that follows standard and/ or overtime resource cost rates.  From what I can tell, it looks like it is using the character equivalent to the OptionsEditEx.HourLabelDisplay = 0 (ie., the first value in the list is "h" for 'hour'). 

    Any help would be realy, really and greatly appreciated!!!


    \Spiro Theopoulos PMP, MCITP. Montreal, QC (Canada)


    Friday, August 9, 2013 3:04 PM

All replies

  • Hi Spiro,

    It is not clear what you exactly ask for - the label for TIME or for COST.

    For the cost fields it is simply available as Project.CurrencySymbol, no need for options.

    As for the hours symbol, let's start with the help:

    HourLabelDisplay

    Optional

    Integer

    Specifies how the hour label displays. The hour label display corresponds to the Hours list, which is found on the Advanced tab. For example, setting the HourLabelDisplay argument to 2 sets the Hours list to the the third value in the list (hour). Valid values are 0-2.

    I really wonder why exactly you would need more. If this sin'tthe answer, what exactly are you after?

    Greetings,

    Friday, August 9, 2013 4:32 PM
    Moderator
  • Hi Jan,

    I was looking to get the "default" hour label that displays after the standard and/ or overtime rates in the resource table (ie., the 'h'), eg., $100.00/h.

    However, I just found a workaround! What I did is I have my macro look at the "Undefined" resource.  Although you can access or view the cost rate tables for the Undefined resource, you can not edit them.  So, in this way I am assured that I have the correct default time value character (i.e., 'h' for $$$ per hour).

    In a nut shell, the reason I need to know or do this is because I end up exporting the cost rates for my resources to Excel, and when I do so I do a search & replace in Excel to strip away and remove the '/h' string from the exported resource rates.  If I were running my macro in eg., in a version of MS Project other than English then the '/h' string that is contained in the hourly rates may not be the same and therefore my search & replace statement for Excel would not work because it could be some other letter in another language for hours which it would not succeed in finding.

    In the majority of cases I find we tend to use $$$ per hour as opposed to the other possible units such as $ per week, month, year or even $$$ per minute which all acceptable resource cost rates entries in MS Project.  If I have an entry that is something other than hours,  I do not strip the time value after the $ amount. 


    \Spiro Theopoulos PMP, MCITP. Montreal, QC (Canada)

    Friday, August 9, 2013 5:58 PM