使用两个参数调用其他子程序时,出现语法错误。
UpdatingActiveWorkbook(workBookPath,13)-突出显示为语法错误。
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
答案 0 :(得分:1)
要么:
1)使用(过时的)Call
关键字
然后可以保留括号:
Call UpdatingActiveWorkbook("C:\334804_PF_Calculation6.xls", 13)
2)或删除括号:
UpdatingActiveWorkbook "C:\334804_PF_Calculation6.xls", 13