Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing schedule within the range includes unwanted months

Status
Not open for further replies.

technar

Technical User
Sep 6, 2011
9
AU
I was trying to write a macro in VBA in Excel which will print a number of schedules (using Adobe PDF, i.e. save as PDF files) ith Status date 1 Sep 11 for the period from 1 Apr 11 to 31 Mar 12.

For some reason print out includes some months outside of that period. Does anyone have any idea what might be the reason of period being changed? (I don't know, many length of tasks or milestones etc.)

Let's assume that my code is correct as I cannot find any errors in it and assume that it is MS Project issue or Adobe PDF issue :)

My code:
ProjectSummaryInfo StatusDate:="30/09/2011"
ProjectSummaryInfo CurrentDate:="30/09/2011"
FilePrint FromDate:="01/04/2011", ToDate:="31/03/2012
 


hi,

Microsoft does not handle dd/mm/yyyy conversion very well, and you are forcing a CONVERSION when you assign date string values.

I would assign dates as such...
Code:
    ProjectSummaryInfo StatusDate:=DateSerial(2011,9,30)
    ProjectSummaryInfo CurrentDate:=DateSerial(2011,9,30)
    FilePrint FromDate:=DateSerial(2011,4,1), ToDate:=DateSerial(2012,3,31)
The problem is Bill Gates was born, raised and operates in the US of A, where the default date structure is m/d/yyyy, not d/m/yyyy. So it is best to use an unambiguous method of date assignment!


Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top