VBA 不接受我的方法调用并给出编译错误:语法错误 [英] VBA does not accept my method calling and gives Compile error: Syntax error
本文介绍了VBA 不接受我的方法调用并给出编译错误:语法错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Public Sub SavePendleValues(ByVal row1 As Integer, ByVal row2 As Integer)
打电话
For sheetrow = 2 To 15 ' number of rows to scan
SavePendleValues (sheetrow, sheetrow)
Next sheetrow
获取错误:编译错误:语法错误
当我取消注释该行时:SavePendleValues (sheetrow, sheetrow)
一切正常.
推荐答案
去掉括号.
SavePendleValues sheetrow, sheetrow
否则,您会尝试将包含两个变量的括号中的内容作为第一个参数传递,这对 VBA 解析器没有意义.
Otherwise you are trying to pass as a first argument something in parentheses that has two variables in it, which doesn't make sense for VBA parser.
这篇关于VBA 不接受我的方法调用并给出编译错误:语法错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文