From: John on 26 Dec 2008 10:52 In article <uYzufutZJHA.1336(a)TK2MSFTNGP02.phx.gbl>, "Steve House [MVP]" <sjhouse at hotmail dot com> wrote: > What is the actual end result you're trying to achieve here - load a > variable with the actual text used in the current version so you can display > it later or are you trying to create a constant to later compare to see if a > field either contains a date entry or displays "NA" or the local version > equivalent? > > If the object is to test whether a date field contains a valid date or is > displaying NA, try the IsDate function. For example, in a project file > containing 1 task, the expression IsDate(ActiveProject.Task(1).ActualFinish) > returns True if a finish date has been entered and False if it's showing NA. > Does that help get you where you need to be? > -- > Steve House [Project MVP] > MS Project Trainer & Consultant > Visit http://project.mvps.org/faqs.htm for the FAQs Steve, Sorry, I didn't notice that you suggested the IsDate several hours before I posted. At least we're thinking along the same lines :-) John > > > "Binoy" <Binoy(a)discussions.microsoft.com> wrote in message > news:54DDB5AB-6CEC-4DCE-90B7-6E61862900D8(a)microsoft.com... > > Hi, > > > > Can someone kindly let me know how I can retrieve the text that Microsoft > > Project uses for empty date fields using VBA, which works across different > > regional settings? For e.g. for a US English installation, the undefined > > date > > value is displayed as "NA". > > > > Is there any property of the activeProject object that I could use for > > this > > purpose? Currently, we use activeProject.Tasks(1).getField(pjTaskStart1) > > at > > the time of initialization of project, but this results in different > > results > > on different machines (NA on most, system date on a few) > > > > Thanks, > > Binoy
From: Binoy on 7 Jan 2009 11:04
Thanks All. The isDate function helps to resolve this issue in a language independent manner. It returns false when the date is NA. "Steve House [MVP]" wrote: > What is the actual end result you're trying to achieve here - load a > variable with the actual text used in the current version so you can display > it later or are you trying to create a constant to later compare to see if a > field either contains a date entry or displays "NA" or the local version > equivalent? > > If the object is to test whether a date field contains a valid date or is > displaying NA, try the IsDate function. For example, in a project file > containing 1 task, the expression IsDate(ActiveProject.Task(1).ActualFinish) > returns True if a finish date has been entered and False if it's showing NA. > Does that help get you where you need to be? > -- > Steve House [Project MVP] > MS Project Trainer & Consultant > Visit http://project.mvps.org/faqs.htm for the FAQs > > > "Binoy" <Binoy(a)discussions.microsoft.com> wrote in message > news:54DDB5AB-6CEC-4DCE-90B7-6E61862900D8(a)microsoft.com... > > Hi, > > > > Can someone kindly let me know how I can retrieve the text that Microsoft > > Project uses for empty date fields using VBA, which works across different > > regional settings? For e.g. for a US English installation, the undefined > > date > > value is displayed as "NA". > > > > Is there any property of the activeProject object that I could use for > > this > > purpose? Currently, we use activeProject.Tasks(1).getField(pjTaskStart1) > > at > > the time of initialization of project, but this results in different > > results > > on different machines (NA on most, system date on a few) > > > > Thanks, > > Binoy > > |