Compile Error "Expected: =" when calling another procedure
vba
Solution
Your procedure call syntax is not right.
This: `Call_01_Adj_Report(div, isWorkaround)`
Needs to be: `Call_01_Adj_Report div, isWorkaround`
Or, with the obsolete explicit call syntax: `Call Call_01_Adj_Report(div, isWorkaround)`
I normally dislike explicit call syntax quite much, but here I like how it highlights how weird the procedure name is. Avoid underscores in public members (should be `PascalCase`), and start procedure names with a verb, e.g. `CreateAdjustmentsReport`:
CreateAdjustmentsReport div, isWorkaround
Problem
I try to call a procedure giving to arguments, it throws a compile error stating "Expected: =". ``` ... 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 __________________________________________ ``` It fails when I insert the call " Call_01_Adj_Report(div, isWorkaround)". It works when giving only one Parameter, but not for two. But in my understanding, the procedure call with arguments syntax is right. What might be the problem?