Resource.OvertimeRate 屬性 (Project)
取得或設定資源的加班工資率。 讀取/寫入 Variant 。
語法
expression。 OvertimeRate
表達 代表 Resource 物件的變數。
註解
OvertimeRate 屬性不會傳回對材料資源有意義的任何資訊。 設定值會傳回可截獲的錯誤 (錯誤代碼 1101年) 套用於材料資源時。
範例
下面範例將使用中專案每一個資源的目前加班工資率設定為標準工資率的 1.5 倍。
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
支援和意見反應
有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應。