我嘗試調用過程給人以參數時,它拋出一個編譯錯誤,指出「預期:=」。編譯錯誤「預期:=」調用另一個程序
...
Dim isWorkaround As Boolean
isWorkaround = False
If Check101.Value = True Then
isWorkaround = True
End If
...
'Procedure I try to call
ElseIf Combo_Report_Selection = "Adjusted Report" And Combo_someOther= "Other" Then
Call_01_Adj_Report(div, isWorkaround)
ElseIf Combo_Report_Selection = "Upload Log" Then
Call_03_Upload_Log
ElseIf Combo_Report_Selection = "Gather Summary" Then
Call_04_Adj_Summary
End If
Combo_Report_Selection.Value = Null
Combo_Statement.Value = Null
End Sub
__________________________________________
Private Sub Call_01_Adj_Report(ByRef calldiv As Long, ByRef isWorkaround As Boolean)
...
End Sub
__________________________________________
當我插入呼叫「Call_01_Adj_Report(div,isWorkaround)」時失敗。 它只適用於一個參數,但不適用於兩個參數。但在我的理解中,使用參數語法的過程調用是正確的。可能是什麼問題?
參見[這是混亂的,爲什麼不總是使用括號?](http://stackoverflow.com/documentation/vba/1179/procedure-calls/3818/this-is-confusing-why-不,剛剛一直使用,括號#T = 201705051655467680223),以瞭解爲什麼你需要刪除括號那裏。您的過程調用語法是* not *權限。 –