The argument value is not valid

M

Mirella Haro

Hi everyone, I have a recent problem with my VB6 project.

A few days ago I upgraded my MsProject from 2003 to 2007 and now
because of that my project has stop working, specific in the
TimeScaleData function when I try to export some information.

This is the code I'm working with right now:

iRes = m_iFindResourceID(Task.ResAssigns.aResAssign(I).lResourceID)
Set PrjAssign =
PrjTask.Assignments.Add(ResourceID:=m_Resources.aResource(iRes).lPrjResID)

'-- Apply monthly values
PrjAssign.Work = 0
Set PrjTSV = PrjAssign.TimeScaleData(PrjTask.Start, PrjTask.Finish,
pjAssignmentTimescaledWork, pjTimescaleMonths)
For iPeriod = 1 To Task.nDuration
If Not IsEqualDouble(.adblWork(iPeriod), 0) Then
If PrjAssign.ResourceType = pjResourceTypeWork Then
PrjTSV(iPeriod).Value = m_dblHrsToMin(.adblWork(iPeriod))
End If
End If
Next

Reviewing my VB code I noticed that the problem is in the date parameter
that I'm sending in the TimeScaleData function. This because the
"PrjAssign.Work = 0" line that is setting my StartDate equals to my EndDate.
Anyone knows why is this happening?

If I erase the "PrjAssign.Work = 0" line my TimeScaleData function works
fine because my StartDate has the value that must have, but with this I'm
getting the "The argument value is not valid" error.

Anyone can help me with this!?
Thanks.
 
M

Mike Glen

Hi Mirella ,

Try posting on the developer newsgroup. Please see FAQ Item: 24. Project
Newsgroups. FAQs, companion products and other useful Project information
can be seen at this web address: http://project.mvps.org/faqs.htm

Mike Glen
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