简体   繁体   English

VB子程序调用语法错误?

[英]Syntax Error On VB Subroutine Call?

In my Visual Basic code behind an Excel spreadsheet, I have one subroutine which takes parameters. 在Excel电子表格后面的Visual Basic代码中,我有一个带参数的子例程。 This is called from another subroutine. 这是从另一个子程序调用的。

Here is the subroutine declaration: 这是子程序声明:

Sub rowPasting(ByVal oldRow As Integer, ByVal newRow As Integer, ByVal oldSheet As Worksheet, ByVal newSheet As Worksheet)

Here is the call: 这是电话:

rowPasting(j,k,TTWorksheet,newSheet)

All the variables I use as inputs for the parameters are set and valid because they were used for working parts of the program before I tried to add this new Subroutine. 我用作参数输入的所有变量都是有效的,因为在我尝试添加这个新的子程序之前,它们被用于程序的工作部分。

Any ideas on what is causing the syntax error on the call? 有关在调用中导致语法错误的原因的任何想法?

To call your subroutine you need to use one of the following syntax: 要调用子例程,您需要使用以下语法之一:

Call rowPasting(j,k,TTWorksheet,newSheet)

or 要么

rowPasting j,k,TTWorksheet,newSheet

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM