I originally asked this question in the 'main' site (link) but given that the behaviour seems to be inherent in MS Project and not to do with using VBA I hoped someone here might be able to advise a workaround if they have encountered the same thing. The same behaviour occurs when performing the same actions via the UI rather than VBA.
I have written a macro that reads in timesheet data and updates the TimeScaleData in the project to update the status. The macro works well overall but I've encountered an issue when one staff member has an arrangement to work on the occasional Saturday or a Sunday, which are defined as a non-working days in the base calendar. The macro successfully adds an exception to the resource's calendar for a working day but it throws out the % Complete calculations.
You can see the effect this has in this screenshot: The Status Date is the 17th but the % Complete bar in the centre of the task bar is showing approximately 1.5 working days after the status date.
As expected, this doesn't occur when I add the exception to the base calendar but it then changes that weekend to a working day for all resources.
I'm not sure if this is something that can be remedied or a result of the way project calculates % Complete across a task with several resources.
Any advice will be appreciated.
Thanks in advance!