Jeevabalan
Jeevabalan

Reputation: 27

Calling other sub using parameter throwing syntax error

While calling other sub with two parameter, i am getting syntax error.

UpdatingActiveWorkbook(workBookPath,13) - highlighting as syntax error.

Sub UpdatingActiveWorkbook(workBookPath As String, workbookname As Integer)


Workbooks.Open workBookPath

Workbooks("MacroWorkbook.xlsm").Activate
Workbooks(workbookname).Activate


ActiveWorkbook.Close

End Sub

Sub callingOtherModule()


UpdatingActiveWorkbook("C:\334804_PF_Calculation6.xls",13)



End Sub

Upvotes: 0

Views: 26

Answers (1)

DisplayName
DisplayName

Reputation: 13386

either you:

1) use the (obsolete) Call keyword

and then you can keep parentheses:

    Call UpdatingActiveWorkbook("C:\334804_PF_Calculation6.xls", 13)

2) or remove parentheses:

    UpdatingActiveWorkbook "C:\334804_PF_Calculation6.xls", 13

Upvotes: 1

Related Questions