How do I get DateFormat(,,, pjDate_mmmm_dd_yyyy) to show DayDay

R

Richard

I am using the following code to save a dump of my project plan to Excel

FileSaveAs Name:=",,,\Integrated Program Plan " &
DateFormat(ActiveProject.CurrentDate, pjDate_mmmm_dd_yyyy) & ".xls",
FormatID:="MSProject.XLS5", map:=",,,", WriteResPassword:=",,,"

My regional long date settings are "MMMM dd, yyyy". I am reading the file
in Excel through a macro which expects the mmmm, dd, yyyy format. The
problem is that for the first nine days of the month, Project is writing
mmmm,d,yyyy, instead of the mmmm,dd,yyyy format specified.

Is there anyway I can enforce the mmmm dd yyyy format in project?

Thanks in advance

Richard
 
J

John

Richard said:
I am using the following code to save a dump of my project plan to Excel

FileSaveAs Name:=",,,\Integrated Program Plan " &
DateFormat(ActiveProject.CurrentDate, pjDate_mmmm_dd_yyyy) & ".xls",
FormatID:="MSProject.XLS5", map:=",,,", WriteResPassword:=",,,"

My regional long date settings are "MMMM dd, yyyy". I am reading the file
in Excel through a macro which expects the mmmm, dd, yyyy format. The
problem is that for the first nine days of the month, Project is writing
mmmm,d,yyyy, instead of the mmmm,dd,yyyy format specified.

Is there anyway I can enforce the mmmm dd yyyy format in project?

Thanks in advance

Richard

Richard,
I don't know of any way to "force" a leading zero on the day (that
doesn't mean there isn't). If someone else has a trick, great.
Meanwhile, I would probably incorporate a string manipulation routine in
the code to either recognize the first nine days or insert leading zeros
where necessary.

Hope this helps.
John
Project MVP
 
R

Richard

That was my next step, but I was hoping for something a touch more elegant.
It's anoying that MS Project and MS Excel handle long dates differently.

Thanks for the response
 
J

John

Richard said:
That was my next step, but I was hoping for something a touch more elegant.
It's anoying that MS Project and MS Excel handle long dates differently.

Thanks for the response


Richard,
Yes, sometimes the application doesn't do what we want or need - that's
why we have VBA. Over the years I have seen new methods added to the
object model that previously required several lines of code to
accomplish with a more "brute force approach". Nonetheless, some
"end-around-run" thinking got me what I needed long ago.

John
Project MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top