Compartir a través de


Propiedad Resource.OvertimeRate (Project)

Obtiene o establece la tasa de horas extra de un recurso. Variante de lectura y escritura.

Sintaxis

expresión. OvertimeRate

Expresión Variable que representa un objeto Resource .

Comentarios

La propiedad OvertimeRate no devuelve ninguna información significativa para recursos materiales. Si se establece un valor devuelve un error capturable (código de error 1101) cuando se aplica a recursos materiales.

Ejemplo:

En el siguiente ejemplo, se establece la tasa de horas extra de cada recurso del proyecto activo en 1,5 veces su tasa estándar.

Sub SetOverTimeRate() 
 
 Dim R As Resource ' Resource object used in For Each loop 
 Dim StdRate As Double ' Numeric value of resource's standard rate 
 Dim Count As Integer ' Counter used in For Next loop 
 Dim FirstNumber As Integer ' Position of the first number 
 
 For Each R In ActiveProject.Resources 
 ' Find the first character that is a number 
 For Count = 1 To Len(R.StandardRate) 
 If IsNumeric(Mid(R.StandardRate, Count, 1)) Then 
 FirstNumber = Count - 1 
 Exit For 
 End If 
 Next Count 
 
 ' Strip off any leading currency symbol and then use the 
 ' Val function to ignore any characters that follow the number 
 StdRate = Val(Right$(R.StandardRate, Len(R.StandardRate) - FirstNumber)) 
 
 ' Set the overtime rate 
 R.OvertimeRate = 1.5 * StdRate 
 Next R 
 
End Sub

Soporte técnico y comentarios

¿Tiene preguntas o comentarios sobre VBA para Office o esta documentación? Vea Soporte técnico y comentarios sobre VBA para Office para obtener ayuda sobre las formas en las que puede recibir soporte técnico y enviar comentarios.