M
Michael Parent
hi
I'm using project 2007 professional and visual basic .net 2005
I created an instance of ms project in my vb project via automation, and I
want to get timescale data by daily for all the ressources assigned for each
tasks
in the code below, the "ass" variable represent a ressource assignment on a
task
and I get often the following error when I try to read values (with the
command TSVs.value)
"erreur inattendue avec la méthode" (in french sorry)
System.Runtime.InteropServices.COMException (0x800A03EC): Erreur inattendue
avec la méthode.
à Microsoft.Office.Interop.MSProject.TimeScaleValue.get_Value()
à Suivi_des_taches.modMain.SyncTachesMSProject(String strFile, Int32
intIDProjet, Int32 intIDProjetMSProject)
by the way, I'm able to get some of the data but it fails most of the time
here is my code :
TSV = ass.TimeScaleData(timeStart, timeEnd,
Microsoft.Office.Interop.MSProject.PjAssignmentTimescaledData.pjAssignmentTimescaledWork,
Microsoft.Office.Interop.MSProject.PjTimescaleUnit.pjTimescaleDays)
For Each TSVs As Microsoft.Office.Interop.MSProject.TimeScaleValue In TSV
Application.DoEvents()
Try
If Not CType(TSVs.Value, String) = "" Then
sngValue = CType(CType(TSVs.Value, Single) / (60), Single)
End If
Catch ex As Exception
intErreur += 1
End Try
Next
I'm using project 2007 professional and visual basic .net 2005
I created an instance of ms project in my vb project via automation, and I
want to get timescale data by daily for all the ressources assigned for each
tasks
in the code below, the "ass" variable represent a ressource assignment on a
task
and I get often the following error when I try to read values (with the
command TSVs.value)
"erreur inattendue avec la méthode" (in french sorry)
System.Runtime.InteropServices.COMException (0x800A03EC): Erreur inattendue
avec la méthode.
à Microsoft.Office.Interop.MSProject.TimeScaleValue.get_Value()
à Suivi_des_taches.modMain.SyncTachesMSProject(String strFile, Int32
intIDProjet, Int32 intIDProjetMSProject)
by the way, I'm able to get some of the data but it fails most of the time
here is my code :
TSV = ass.TimeScaleData(timeStart, timeEnd,
Microsoft.Office.Interop.MSProject.PjAssignmentTimescaledData.pjAssignmentTimescaledWork,
Microsoft.Office.Interop.MSProject.PjTimescaleUnit.pjTimescaleDays)
For Each TSVs As Microsoft.Office.Interop.MSProject.TimeScaleValue In TSV
Application.DoEvents()
Try
If Not CType(TSVs.Value, String) = "" Then
sngValue = CType(CType(TSVs.Value, Single) / (60), Single)
End If
Catch ex As Exception
intErreur += 1
End Try
Next